Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.5 - fixes and GH issues #1342

Merged
merged 75 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
4ebf1ea
chore: update frontend dependencies
PiotrIw Aug 16, 2023
39c5a50
feat: add text_content field to letter attachment
PiotrIw Aug 17, 2023
d7f9dba
feat: addtext_content_update_result field to letter attachment
PiotrIw Aug 17, 2023
7ede255
fix: correct class name
PiotrIw Aug 17, 2023
322739a
feat: add attachment text content update method
PiotrIw Aug 17, 2023
d1e3587
refactor: isort
PiotrIw Aug 17, 2023
6a3687d
chore: add logginng
PiotrIw Aug 18, 2023
1ea04ec
feat: add field to store letter AI evaluation
PiotrIw Aug 21, 2023
edf24ac
feat: add letter AI evaluation display
PiotrIw Aug 21, 2023
183bfb5
feat: add OpenAI settings
PiotrIw Aug 21, 2023
374325f
feat: add OpenAI dependencies
PiotrIw Aug 21, 2023
330c7d2
feat: add OpenAI letter evaluation code
PiotrIw Aug 21, 2023
338e042
feat: show atatchment count
PiotrIw Aug 21, 2023
feccf86
feat: add attachment text content display
PiotrIw Aug 22, 2023
eaaf146
feat: add AI evaluation options explanation
PiotrIw Aug 22, 2023
3ef605e
feat: add monitoring results field
PiotrIw Aug 22, 2023
38a6ed5
feat: add monitoring reluslts template, view and form
PiotrIw Aug 22, 2023
b7d7dc5
feat: update translations
PiotrIw Aug 22, 2023
6987fb8
chore: version bumpup
PiotrIw Aug 22, 2023
75c0dfe
feat: add AI evaluation management command
PiotrIw Aug 22, 2023
fafe8ec
Merge pull request #38 from PiotrIw/response_eval
PiotrIw Aug 22, 2023
eec850b
Merge pull request #1327 from PiotrIw/develop
PiotrIw Aug 22, 2023
15a8b4a
Merge pull request #1328 from watchdogpolska/dev_ext
PiotrIw Aug 22, 2023
d1612c1
fix: correct typo
PiotrIw Aug 22, 2023
4e8bf68
fix: correct typo
PiotrIw Aug 22, 2023
8deaa71
fix: correct typo
PiotrIw Aug 22, 2023
34c40bb
fix typo
PiotrIw Sep 25, 2023
4b2c947
add OpenAI settings to env
PiotrIw Sep 25, 2023
4fa812f
improve propmts
PiotrIw Sep 25, 2023
c48a3f7
improve console output readability
PiotrIw Sep 25, 2023
fc49ebd
update django-teryt-tree
PiotrIw Sep 25, 2023
4d00a65
version bumpup
PiotrIw Sep 25, 2023
7c12c8e
run upgrade pip with updated repo list
PiotrIw Sep 25, 2023
ce7d830
update precommit
PiotrIw Sep 25, 2023
7342331
bumpup readthedocs dependencies
PiotrIw Sep 25, 2023
602f048
bumpup dependencies
PiotrIw Sep 25, 2023
d9a4bba
fix flake line too long error
PiotrIw Sep 25, 2023
329abde
fix flake line too long error
PiotrIw Sep 25, 2023
8daf2e5
provide numerical defaults
PiotrIw Sep 25, 2023
b8ff8bc
Merge pull request #39 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 25, 2023
18b842a
replace unmaintained version with updated fork
PiotrIw Sep 26, 2023
e45b2c6
version bumpup
PiotrIw Sep 26, 2023
87f577d
Merge pull request #40 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
2a71cd0
update django-background-tasks
PiotrIw Sep 26, 2023
b72f13b
Merge pull request #41 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
39b6811
version bumpup
PiotrIw Sep 26, 2023
df5cb98
Merge pull request #42 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
1d26ae8
replace unmaintained django-bootstrap-pagination with updated fork
PiotrIw Sep 26, 2023
f56a892
Merge pull request #43 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
88b402b
refactor for django 3.2 compatibility
PiotrIw Sep 26, 2023
9fe8409
refactor for django 3.2 compatibility
PiotrIw Sep 26, 2023
5aafd64
Merge pull request #44 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
d3b938a
fix typo
PiotrIw Sep 26, 2023
e86339f
Merge pull request #45 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
38a4a7f
add sphinx styling
PiotrIw Sep 26, 2023
388535b
Merge pull request #46 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Sep 26, 2023
7385c37
Merge pull request #1336 from PiotrIw/develop
PiotrIw Sep 26, 2023
ccac183
Merge branch 'develop' into dev_ext
PiotrIw Sep 26, 2023
36aaa62
Merge pull request #1337 from watchdogpolska/dev_ext
PiotrIw Sep 26, 2023
536a78a
Update web_image_buil_and_push.yml
PiotrIw Sep 26, 2023
553338d
Merge pull request #1338 from watchdogpolska/dev_ext
PiotrIw Sep 26, 2023
ce47100
Update web_image_buil_and_push.yml
PiotrIw Sep 26, 2023
668bf96
Merge branch 'develop' into dev_ext
PiotrIw Sep 26, 2023
a4181e7
Merge pull request #1339 from watchdogpolska/dev_ext
PiotrIw Sep 26, 2023
5fd05db
fix issues 1323, 1331
PiotrIw Oct 2, 2023
f6c3888
fix: issue 1330
PiotrIw Oct 2, 2023
85b9155
fix: issue 1334
PiotrIw Oct 2, 2023
50a4611
fix: correct help
PiotrIw Oct 2, 2023
1682468
feat: add management command to update attachemnts texts
PiotrIw Oct 2, 2023
2415714
feat: update attachments text for incoming email
PiotrIw Oct 2, 2023
6145c20
Merge pull request #47 from PiotrIw/test-django-teryt-tree-0.18.0
PiotrIw Oct 2, 2023
727df23
Merge pull request #1340 from PiotrIw/develop
PiotrIw Oct 2, 2023
7e1ffab
Merge pull request #1341 from watchdogpolska/dev_ext
PiotrIw Oct 2, 2023
ab4e79f
Update __init__.py
PiotrIw Oct 2, 2023
bfacee1
Merge branch 'master' into develop
PiotrIw Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .contrib/docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
ARG PYTHON_VERSION='3.10.6'
FROM python:${PYTHON_VERSION}-slim
RUN python --version
RUN pip install --upgrade pip
RUN pip --version
RUN mkdir /code /code/production
WORKDIR /code

Expand All @@ -20,6 +18,8 @@ RUN apt-get update \
htop \
gettext libgettextpo-dev wait-for-it \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip --version
COPY requirements/*.txt ./requirements/
ARG DJANGO_VERSION='==3.2.20'
# TODO: Move to /requirements/base.txt after fixing following bug:
Expand Down
4 changes: 2 additions & 2 deletions .contrib/docker/Dockerfile.web.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
ARG PYTHON_VERSION='3.10.6'
FROM python:${PYTHON_VERSION}-slim
RUN python --version
RUN pip install --upgrade pip
RUN pip --version
RUN mkdir /code code/media code/staticfiles
WORKDIR /code

Expand All @@ -20,6 +18,8 @@ RUN apt-get update \
htop \
gettext libgettextpo-dev wait-for-it \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN pip --version
COPY requirements/*.txt ./requirements/
ARG DJANGO_VERSION='==3.2.20'
# TODO: Move to /requirements/base.txt after fixing following bug:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web_image_buil_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && (github.ref == 'master' || github.ref == 'develop')
if: github.event.pull_request.merged == true && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ sphinx:
configuration: docs/conf.py
formats: all

build:
os: ubuntu-22.04
tools:
python: "3.10"

python:
install:
- requirements: requirements/dev.txt
11 changes: 11 additions & 0 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,9 @@
ELASTICSEARCH_URL = env("ELASTICSEARCH_URL", default=None)
APACHE_TIKA_URL = env("APACHE_TIKA_URL", default="http://localhost:9998/tika")

FILE_TO_TEXT_URL = env("FILE_TO_TEXT_URL", default="http://localhost:9980/")
FILE_TO_TEXT_TOKEN = env("FILE_TO_TEXT_TOKEN", default="")

ELASTICSEARCH_SHOW_SIMILAR = env("ELASTICSEARCH_SHOW_SIMILAR", default=False)

# To avoid unwanted migrations when upgrading to Django 3.2
Expand Down Expand Up @@ -500,3 +503,11 @@
"acronym": ["title"],
"img": ["alt", "src", "title"],
}

OPENAI_API_KEY = env.str("OPENAI_API_KEY", "")
OPENAI_LLM_MODEL = env.str("OPENAI_LLM_MODEL", "gpt-3.5-turbo")
OPENAI_LLM_MODEL_MAX_TOKENS = env.int("OPENAI_LLM_MODEL_MAX_TOKENS", 4000)
OPENAI_LLM_MODEL_LARGE = env.str("OPENAI_LLM_MODEL", "gpt-3.5-turbo-16k")
OPENAI_LLM_MODEL_LARGE_MAX_TOKENS = env.int("OPENAI_LLM_MODEL_LARGE_MAX_TOKENS", 16000)
OPENAI_LLM_TEMPERATURE = env.float("OPENAI_LLM_TEMPERATURE", 0.0)
OPENAI_MAX_RETRIES = env.int("OPENAI_MAX_RETRIES", 5)
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ services:
ATTACHMENTSCANNER_API_KEY: ""
ATTACHMENTSCANNER_API_URL: ""
METADEFENDER_API_KEY: ${METADEFENDER_API_KEY}
FILE_TO_TEXT_URL: ${FILE_TO_TEXT_URL}
FILE_TO_TEXT_TOKEN: ${FILE_TO_TEXT_TOKEN}
OPENAI_API_KEY: ${OPENAI_API_KEY}
OPENAI_LLM_MODEL: ${OPENAI_LLM_MODEL}
OPENAI_LLM_MODEL_MAX_TOKENS: ${OPENAI_LLM_MODEL_MAX_TOKENS:-4000}
OPENAI_LLM_MODEL_LARGE: ${OPENAI_LLM_MODEL_LARGE}
OPENAI_LLM_MODEL_LARGE_MAX_TOKENS: ${OPENAI_LLM_MODEL_LARGE_MAX_TOKENS:-16000}
ports:
- "8000:8000"
# Following allows to execute `docker attach feder_web_1`
Expand Down
2 changes: 1 addition & 1 deletion feder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PEP 396: The __version__ attribute's value SHOULD be a string.
__version__ = "1.1.27"
__version__ = "1.2.5"


# Compatibility to eg. django-rest-framework
Expand Down
2 changes: 1 addition & 1 deletion feder/alerts/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: alerts 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-22 11:13+0000\n"
"POT-Creation-Date: 2023-10-02 09:50+0000\n"
"PO-Revision-Date: 2016-09-18 01:57+0200\n"
"Last-Translator: Adam Dobrawy <[email protected]>\n"
"Language-Team: pl_PL <[email protected]>\n"
Expand Down
9 changes: 9 additions & 0 deletions feder/cases/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ class CaseAdmin(VersionAdmin, GuardedModelAdmin):
"email",
"tags__name",
]
readonly_fields = [
"id",
"slug",
"first_request",
"last_request",
"monitoring",
"email",
"institution",
]
list_filter = [
"confirmation_received",
"response_received",
Expand Down
Binary file modified feder/cases/locale/pl/LC_MESSAGES/django.mo
Binary file not shown.
10 changes: 7 additions & 3 deletions feder/cases/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: cases 0.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-22 11:13+0000\n"
"PO-Revision-Date: 2023-06-15 14:07+0000\n"
"POT-Creation-Date: 2023-10-02 09:50+0000\n"
"PO-Revision-Date: 2023-08-22 10:20+0000\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: Adam Dobrawy <[email protected]>\n"
"Language: pl_PL\n"
Expand Down Expand Up @@ -262,7 +262,11 @@ msgstr "Powiat"
msgid "Voivodeship"
msgstr "Województwo"

#: feder/cases/viewsets.py:95
#: feder/cases/viewsets.py:56
msgid "URL"
msgstr "URL"

#: feder/cases/viewsets.py:96
msgid "case_report"
msgstr "raport_spraw"

Expand Down
2 changes: 1 addition & 1 deletion feder/cases_tags/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-22 11:13+0000\n"
"POT-Creation-Date: 2023-10-02 09:50+0000\n"
"PO-Revision-Date: 2021-01-29 01:44+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion feder/domains/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-22 11:13+0000\n"
"POT-Creation-Date: 2023-10-02 09:50+0000\n"
"PO-Revision-Date: 2023-05-16 13:12+0000\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: \n"
Expand Down
13 changes: 6 additions & 7 deletions feder/institutions/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,36 @@ msgid ""
msgstr ""
"Project-Id-Version: django-institutions 0.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-22 11:13+0000\n"
"POT-Creation-Date: 2023-10-02 09:50+0000\n"
"PO-Revision-Date: 2023-06-22 11:14+0000\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: Adam Dobrawy <[email protected]>\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 2.0.6\n"
"X-Translated-Using: django-rosetta 0.9.9\n"

#: feder/institutions/admin.py:30
#| msgid "Institutions"
msgid "Institution tags"
msgstr "Tagi instytucji"

#: feder/institutions/admin.py:34
msgid "Teryt code"
msgstr "Kod Teryt"

#: feder/institutions/admin.py:38
#| msgid "Parent institutions"
#: feder/institutions/admin.py:38 feder/institutions/admin.py:44
msgid "Mark selected institution as archival"
msgstr "Oznacz wybraną instytucję jako archiwalną"

#: feder/institutions/admin.py:44
#: feder/institutions/admin.py:46 feder/institutions/admin.py:53
msgid "Mark selected institution as NON archival"
msgstr "Oznacz wybraną instytucję jako NIE archiwalną"

#: feder/institutions/admin.py:64
#: feder/institutions/admin.py:70
msgid "Institution count"
msgstr "Liczba instytucji"

Expand Down
4 changes: 4 additions & 0 deletions feder/institutions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def __str__(self):
return self.name + _(" (archival)")
return self.name

@property
def name_with_jst(self):
return f"{self.name}; {self.jst.tree_name}"

def get_absolute_url(self):
return reverse("institutions:details", kwargs={"slug": self.slug})

Expand Down
3 changes: 3 additions & 0 deletions feder/institutions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def get_queryset(self):
qs = qs.filter(name__icontains=self.q)
return qs.all().order_by("name")

def get_result_label(self, result):
return f"{result.name_with_jst}"


class TagAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
Expand Down
Binary file modified feder/letters/locale/pl/LC_MESSAGES/django.mo
Binary file not shown.
Loading