diff --git a/api/utils/serializer/v1/ecoaccount.py b/api/utils/serializer/v1/ecoaccount.py index 241d3624..7fe4373d 100644 --- a/api/utils/serializer/v1/ecoaccount.py +++ b/api/utils/serializer/v1/ecoaccount.py @@ -9,7 +9,7 @@ from django.db import transaction from api.utils.serializer.v1.serializer import AbstractModelAPISerializerV1, AbstractCompensationAPISerializerV1Mixin, \ LegalAPISerializerV1Mixin, ResponsibilityAPISerializerV1Mixin, DeductableAPISerializerV1Mixin -from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_COMPENSATION_HANDLER_ID +from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_HANDLER_ID from compensation.models import EcoAccount from intervention.models import Legal, Responsibility, Handler from konova.models import Geometry @@ -66,7 +66,7 @@ class EcoAccountAPISerializerV1(AbstractModelAPISerializerV1, obj.responsible.conservation_file_number = responsibility_data["conservation_file_number"] obj.responsible.handler.type = self._konova_code_from_json( responsibility_data["handler"]["type"], - CODELIST_COMPENSATION_HANDLER_ID, + CODELIST_HANDLER_ID, ) obj.responsible.handler.detail = responsibility_data["handler"]["detail"] return obj diff --git a/api/utils/serializer/v1/ema.py b/api/utils/serializer/v1/ema.py index 548a7dbf..dfda7249 100644 --- a/api/utils/serializer/v1/ema.py +++ b/api/utils/serializer/v1/ema.py @@ -9,7 +9,7 @@ from django.db import transaction from api.utils.serializer.v1.serializer import AbstractModelAPISerializerV1, AbstractCompensationAPISerializerV1Mixin, \ ResponsibilityAPISerializerV1Mixin -from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_COMPENSATION_HANDLER_ID +from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_HANDLER_ID from ema.models import Ema from intervention.models import Responsibility, Handler from konova.models import Geometry @@ -53,7 +53,7 @@ class EmaAPISerializerV1(AbstractModelAPISerializerV1, AbstractCompensationAPISe obj.responsible.conservation_file_number = responsibility_data["conservation_file_number"] obj.responsible.handler.type = self._konova_code_from_json( responsibility_data["handler"]["type"], - CODELIST_COMPENSATION_HANDLER_ID, + CODELIST_HANDLER_ID, ) obj.responsible.handler.detail = responsibility_data["handler"]["detail"] return obj diff --git a/api/utils/serializer/v1/serializer.py b/api/utils/serializer/v1/serializer.py index 924b6e3b..23d1f692 100644 --- a/api/utils/serializer/v1/serializer.py +++ b/api/utils/serializer/v1/serializer.py @@ -15,7 +15,7 @@ from api.utils.serializer.serializer import AbstractModelAPISerializer from codelist.models import KonovaCode from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_ID, CODELIST_PROCESS_TYPE_ID, \ CODELIST_LAW_ID, CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID, \ - CODELIST_COMPENSATION_ACTION_DETAIL_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, CODELIST_COMPENSATION_HANDLER_ID + CODELIST_COMPENSATION_ACTION_DETAIL_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, CODELIST_HANDLER_ID from compensation.models import CompensationAction, UnitChoices, CompensationState from intervention.models import Responsibility, Legal, Handler from konova.models import Deadline, DeadlineType @@ -223,7 +223,7 @@ class ResponsibilityAPISerializerV1Mixin: obj.responsible.conservation_file_number = responsibility_data["conservation_file_number"] obj.responsible.handler.type = self._konova_code_from_json( responsibility_data["handler"]["type"], - CODELIST_COMPENSATION_HANDLER_ID, + CODELIST_HANDLER_ID, ) obj.responsible.handler.detail = responsibility_data["handler"]["detail"] return obj diff --git a/codelist/management/commands/update_codelist.py b/codelist/management/commands/update_codelist.py index 85c90324..345b3244 100644 --- a/codelist/management/commands/update_codelist.py +++ b/codelist/management/commands/update_codelist.py @@ -11,7 +11,7 @@ from xml.etree import ElementTree as etree from codelist.models import KonovaCode, KonovaCodeList from codelist.settings import CODELIST_INTERVENTION_HANDLER_ID, CODELIST_CONSERVATION_OFFICE_ID, \ - CODELIST_REGISTRATION_OFFICE_ID, CODELIST_BIOTOPES_ID, CODELIST_LAW_ID, CODELIST_COMPENSATION_HANDLER_ID, \ + CODELIST_REGISTRATION_OFFICE_ID, CODELIST_BIOTOPES_ID, CODELIST_LAW_ID, CODELIST_HANDLER_ID, \ CODELIST_COMPENSATION_ACTION_ID, CODELIST_COMPENSATION_ACTION_CLASS_ID, CODELIST_COMPENSATION_ADDITIONAL_TYPE_ID, \ CODELIST_BASE_URL, CODELIST_PROCESS_TYPE_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, \ CODELIST_COMPENSATION_ACTION_DETAIL_ID @@ -36,7 +36,7 @@ class Command(BaseKonovaCommand): CODELIST_BIOTOPES_ID, CODELIST_BIOTOPES_EXTRA_CODES_ID, CODELIST_LAW_ID, - CODELIST_COMPENSATION_HANDLER_ID, + CODELIST_HANDLER_ID, CODELIST_COMPENSATION_ACTION_ID, CODELIST_COMPENSATION_ACTION_CLASS_ID, CODELIST_COMPENSATION_ACTION_DETAIL_ID, diff --git a/codelist/settings.py b/codelist/settings.py index b4226b5e..61652bd0 100644 --- a/codelist/settings.py +++ b/codelist/settings.py @@ -19,7 +19,7 @@ CODELIST_BIOTOPES_EXTRA_CODES_ID = 975 # CLZusatzbezeichnung CODELIST_LAW_ID = 1048 # CLVerfahrensrecht CODELIST_PROCESS_TYPE_ID = 44382 # CLVerfahrenstyp -CODELIST_COMPENSATION_HANDLER_ID = 1052 # CLEingreifer +CODELIST_HANDLER_ID = 1052 # CLEingreifer CODELIST_COMPENSATION_ACTION_ID = 1026 # CLMassnahmedetail CODELIST_COMPENSATION_ACTION_DETAIL_ID = 1035 # CLZusatzmerkmal CODELIST_COMPENSATION_ACTION_CLASS_ID = 1034 # CLMassnahmeklasse diff --git a/compensation/forms/forms.py b/compensation/forms/forms.py index 768a6fed..4e9e329e 100644 --- a/compensation/forms/forms.py +++ b/compensation/forms/forms.py @@ -13,7 +13,7 @@ from django.utils.translation import gettext_lazy as _ from django import forms from codelist.models import KonovaCode -from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_COMPENSATION_HANDLER_ID +from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_HANDLER_ID from compensation.models import Compensation, EcoAccount from intervention.inputs import GenerateInput from intervention.models import Intervention, Responsibility, Legal, Handler @@ -110,7 +110,7 @@ class CompensationResponsibleFormMixin(forms.Form): queryset=KonovaCode.objects.filter( is_archived=False, is_leaf=True, - code_lists__in=[CODELIST_COMPENSATION_HANDLER_ID], + code_lists__in=[CODELIST_HANDLER_ID], ), widget=autocomplete.ModelSelect2( url="codes-handler-autocomplete", diff --git a/intervention/forms/forms.py b/intervention/forms/forms.py index 1ed10e19..b83c4fba 100644 --- a/intervention/forms/forms.py +++ b/intervention/forms/forms.py @@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode from codelist.settings import CODELIST_PROCESS_TYPE_ID, CODELIST_LAW_ID, \ - CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID, CODELIST_COMPENSATION_HANDLER_ID + CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID, CODELIST_HANDLER_ID from intervention.inputs import GenerateInput from intervention.models import Intervention, Legal, Responsibility, Handler from konova.forms import BaseForm, SimpleGeomForm @@ -146,7 +146,7 @@ class NewInterventionForm(BaseForm): queryset=KonovaCode.objects.filter( is_archived=False, is_leaf=True, - code_lists__in=[CODELIST_COMPENSATION_HANDLER_ID], + code_lists__in=[CODELIST_HANDLER_ID], ), widget=autocomplete.ModelSelect2( url="codes-handler-autocomplete", diff --git a/intervention/models/responsibility.py b/intervention/models/responsibility.py index 6f34ba5b..5d1c84a6 100644 --- a/intervention/models/responsibility.py +++ b/intervention/models/responsibility.py @@ -10,8 +10,9 @@ from django.utils.translation import gettext_lazy as _ from codelist.models import KonovaCode from codelist.settings import CODELIST_CONSERVATION_OFFICE_ID, CODELIST_REGISTRATION_OFFICE_ID, \ - CODELIST_COMPENSATION_HANDLER_ID + CODELIST_HANDLER_ID from konova.models import UuidModel +from konova.utils.message_templates import UNKNOWN, NO_DETAILS class Handler(UuidModel): @@ -26,7 +27,7 @@ class Handler(UuidModel): null=True, blank=True, limit_choices_to={ - "code_lists__in": [CODELIST_COMPENSATION_HANDLER_ID], + "code_lists__in": [CODELIST_HANDLER_ID], "is_selectable": True, "is_archived": False, } @@ -38,8 +39,8 @@ class Handler(UuidModel): ) def __str__(self): - detail = self.detail or _("no further details") - _type = self.type.long_name if self.type is not None else None + detail = self.detail or NO_DETAILS + _type = self.type.long_name if self.type is not None else UNKNOWN return f'{_type}, {detail}' diff --git a/konova/autocompletes.py b/konova/autocompletes.py index 0b498517..9f60d54f 100644 --- a/konova/autocompletes.py +++ b/konova/autocompletes.py @@ -17,7 +17,7 @@ from django.db.models import Q from codelist.models import KonovaCode from codelist.settings import CODELIST_COMPENSATION_ACTION_ID, CODELIST_BIOTOPES_ID, CODELIST_LAW_ID, \ CODELIST_REGISTRATION_OFFICE_ID, CODELIST_CONSERVATION_OFFICE_ID, CODELIST_PROCESS_TYPE_ID, \ - CODELIST_BIOTOPES_EXTRA_CODES_ID, CODELIST_COMPENSATION_ACTION_DETAIL_ID, CODELIST_COMPENSATION_HANDLER_ID + CODELIST_BIOTOPES_EXTRA_CODES_ID, CODELIST_COMPENSATION_ACTION_DETAIL_ID, CODELIST_HANDLER_ID from compensation.models import EcoAccount from intervention.models import Intervention @@ -367,7 +367,7 @@ class HandlerCodeAutocomplete(KonovaCodeAutocomplete): related_field_name = "long_name" def __init__(self, *args, **kwargs): - self.c = CODELIST_COMPENSATION_HANDLER_ID + self.c = CODELIST_HANDLER_ID super().__init__(*args, **kwargs) def get_result_label(self, result): diff --git a/konova/utils/message_templates.py b/konova/utils/message_templates.py index 6c0c6148..64b7eab1 100644 --- a/konova/utils/message_templates.py +++ b/konova/utils/message_templates.py @@ -7,6 +7,8 @@ Created on: 02.08.21 """ from django.utils.translation import gettext_lazy as _ +NO_DETAILS = _("no further details") +UNKNOWN = _("Unknown") UNGROUPED = _("Ungrouped") FORM_INVALID = _("There was an error on this form.") PARAMS_INVALID = _("Invalid parameters") diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index c032d762..b3bf61fd 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 6edaeb1b..e8786ab9 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-03 10:50+0100\n" +"POT-Creation-Date: 2022-03-03 12:08+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1159,7 +1159,7 @@ msgstr "Daten zu den verantwortlichen Stellen" msgid "Compensations - Overview" msgstr "Kompensationen - Übersicht" -#: compensation/views/compensation.py:151 konova/utils/message_templates.py:33 +#: compensation/views/compensation.py:151 konova/utils/message_templates.py:35 msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" @@ -1446,10 +1446,6 @@ msgstr "" "Das Ökokonto {} hat für eine Abbuchung von {} m² nicht ausreichend " "Restfläche. Es stehen noch {} m² zur Verfügung." -#: intervention/models/responsibility.py:41 -msgid "no further details" -msgstr "keine weitere Angabe" - #: intervention/templates/intervention/detail/includes/compensations.html:14 msgid "Add new compensation" msgstr "Neue Kompensation hinzufügen" @@ -1843,22 +1839,31 @@ msgid "Request for new API token" msgstr "Anfrage für neuen API Token" #: konova/utils/message_templates.py:10 +msgid "no further details" +msgstr "keine weitere Angabe" + +#: konova/utils/message_templates.py:11 +#: venv/lib/python3.7/site-packages/django/forms/widgets.py:709 +msgid "Unknown" +msgstr "Unbekannt" + +#: konova/utils/message_templates.py:12 msgid "Ungrouped" msgstr "Ohne Zuordnung" -#: konova/utils/message_templates.py:11 +#: konova/utils/message_templates.py:13 msgid "There was an error on this form." msgstr "Es gab einen Fehler im Formular." -#: konova/utils/message_templates.py:12 +#: konova/utils/message_templates.py:14 msgid "Invalid parameters" msgstr "Parameter ungültig" -#: konova/utils/message_templates.py:13 +#: konova/utils/message_templates.py:15 msgid "There are errors in this intervention." msgstr "Es liegen Fehler in diesem Eingriff vor:" -#: konova/utils/message_templates.py:14 +#: konova/utils/message_templates.py:16 msgid "" "The identifier '{}' had to be changed to '{}' since another entry has been " "added in the meanwhile, which uses this identifier" @@ -1866,26 +1871,26 @@ msgstr "" "Die Kennung '{}' musste zu '{}' geändert werden, da ein anderer Eintrag in " "der Zwischenzeit angelegt wurde, welcher diese Kennung nun bereits verwendet" -#: konova/utils/message_templates.py:15 +#: konova/utils/message_templates.py:17 msgid "" "Only conservation or registration office users are allowed to remove entries." msgstr "" "Nur Mitarbeiter der Naturschutz- oder Zulassungsbehördengruppe dürfen " "Einträge entfernen" -#: konova/utils/message_templates.py:16 +#: konova/utils/message_templates.py:18 msgid "You need to be part of another user group." msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!" -#: konova/utils/message_templates.py:17 +#: konova/utils/message_templates.py:19 msgid "Status of Checked and Recorded reseted" msgstr "'Geprüft'/'Verzeichnet' wurde zurückgesetzt" -#: konova/utils/message_templates.py:20 +#: konova/utils/message_templates.py:22 msgid "This data is not shared with you" msgstr "Diese Daten sind für Sie nicht freigegeben" -#: konova/utils/message_templates.py:21 +#: konova/utils/message_templates.py:23 msgid "" "Remember: This data has not been shared with you, yet. This means you can " "only read but can not edit or perform any actions like running a check or " @@ -1895,15 +1900,15 @@ msgstr "" "bedeutet, dass Sie nur lesenden Zugriff hierauf haben und weder bearbeiten, " "noch Prüfungen durchführen oder verzeichnen können." -#: konova/utils/message_templates.py:24 +#: konova/utils/message_templates.py:26 msgid "Unsupported file type" msgstr "Dateiformat nicht unterstützt" -#: konova/utils/message_templates.py:25 +#: konova/utils/message_templates.py:27 msgid "File too large" msgstr "Datei zu groß" -#: konova/utils/message_templates.py:28 +#: konova/utils/message_templates.py:30 msgid "" "Action canceled. Eco account is recorded or deductions exist. Only " "conservation office member can perform this action." @@ -1911,119 +1916,119 @@ msgstr "" "Aktion abgebrochen. Ökokonto ist bereits verzeichnet oder Abbuchungen liegen " "vor. Nur Eintragungsstellennutzer können diese Aktion jetzt durchführen." -#: konova/utils/message_templates.py:31 +#: konova/utils/message_templates.py:33 msgid "Compensation {} added" msgstr "Kompensation {} hinzugefügt" -#: konova/utils/message_templates.py:32 +#: konova/utils/message_templates.py:34 msgid "Compensation {} removed" msgstr "Kompensation {} entfernt" -#: konova/utils/message_templates.py:34 +#: konova/utils/message_templates.py:36 msgid "Added compensation action" msgstr "Maßnahme hinzugefügt" -#: konova/utils/message_templates.py:35 +#: konova/utils/message_templates.py:37 msgid "Added compensation state" msgstr "Zustand hinzugefügt" -#: konova/utils/message_templates.py:38 +#: konova/utils/message_templates.py:40 msgid "State removed" msgstr "Zustand gelöscht" -#: konova/utils/message_templates.py:39 +#: konova/utils/message_templates.py:41 msgid "State edited" msgstr "Zustand bearbeitet" -#: konova/utils/message_templates.py:40 +#: konova/utils/message_templates.py:42 msgid "State added" msgstr "Zustand hinzugefügt" -#: konova/utils/message_templates.py:43 +#: konova/utils/message_templates.py:45 msgid "Action added" msgstr "Maßnahme hinzugefügt" -#: konova/utils/message_templates.py:44 +#: konova/utils/message_templates.py:46 msgid "Action edited" msgstr "Maßnahme bearbeitet" -#: konova/utils/message_templates.py:45 +#: konova/utils/message_templates.py:47 msgid "Action removed" msgstr "Maßnahme entfernt" -#: konova/utils/message_templates.py:48 +#: konova/utils/message_templates.py:50 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" -#: konova/utils/message_templates.py:49 +#: konova/utils/message_templates.py:51 msgid "Deduction edited" msgstr "Abbuchung bearbeitet" -#: konova/utils/message_templates.py:50 +#: konova/utils/message_templates.py:52 msgid "Deduction removed" msgstr "Abbuchung entfernt" -#: konova/utils/message_templates.py:53 +#: konova/utils/message_templates.py:55 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" -#: konova/utils/message_templates.py:54 +#: konova/utils/message_templates.py:56 msgid "Deadline edited" msgstr "Frist/Termin bearbeitet" -#: konova/utils/message_templates.py:55 +#: konova/utils/message_templates.py:57 msgid "Deadline removed" msgstr "Frist/Termin gelöscht" -#: konova/utils/message_templates.py:58 +#: konova/utils/message_templates.py:60 msgid "Payment added" msgstr "Zahlung hinzugefügt" -#: konova/utils/message_templates.py:59 +#: konova/utils/message_templates.py:61 msgid "Payment edited" msgstr "Zahlung bearbeitet" -#: konova/utils/message_templates.py:60 +#: konova/utils/message_templates.py:62 msgid "Payment removed" msgstr "Zahlung gelöscht" -#: konova/utils/message_templates.py:63 +#: konova/utils/message_templates.py:65 msgid "Revocation added" msgstr "Widerspruch hinzugefügt" -#: konova/utils/message_templates.py:64 +#: konova/utils/message_templates.py:66 msgid "Revocation edited" msgstr "Widerspruch bearbeitet" -#: konova/utils/message_templates.py:65 +#: konova/utils/message_templates.py:67 msgid "Revocation removed" msgstr "Widerspruch entfernt" -#: konova/utils/message_templates.py:68 +#: konova/utils/message_templates.py:70 msgid "Document '{}' deleted" msgstr "Dokument '{}' gelöscht" -#: konova/utils/message_templates.py:69 +#: konova/utils/message_templates.py:71 msgid "Document added" msgstr "Dokument hinzugefügt" -#: konova/utils/message_templates.py:70 +#: konova/utils/message_templates.py:72 msgid "Document edited" msgstr "Dokument bearbeitet" -#: konova/utils/message_templates.py:73 +#: konova/utils/message_templates.py:75 msgid "Edited general data" msgstr "Allgemeine Daten bearbeitet" -#: konova/utils/message_templates.py:74 +#: konova/utils/message_templates.py:76 msgid "Added deadline" msgstr "Frist/Termin hinzugefügt" -#: konova/utils/message_templates.py:77 +#: konova/utils/message_templates.py:79 msgid "Geometry conflict detected with {}" msgstr "Geometriekonflikt mit folgenden Einträgen erkannt: {}" -#: konova/utils/message_templates.py:80 +#: konova/utils/message_templates.py:82 msgid "This intervention has {} revocations" msgstr "Dem Eingriff liegen {} Widersprüche vor" @@ -3599,10 +3604,6 @@ msgstr "" msgid "Change" msgstr "" -#: venv/lib/python3.7/site-packages/django/forms/widgets.py:709 -msgid "Unknown" -msgstr "" - #. Translators: Please do not add spaces around commas. #: venv/lib/python3.7/site-packages/django/template/defaultfilters.py:790 msgid "yes,no,maybe"