From 6cb1a31aff89067106f312e9db5f98dcb3572bdd Mon Sep 17 00:00:00 2001 From: mpeltriaux Date: Wed, 17 Nov 2021 14:33:05 +0100 Subject: [PATCH] Refactors triggering checked/recorded * refactors BaseForm request/user initialization * introduces mark_as_edited() method for compensation models --- compensation/forms/forms.py | 3 +- compensation/forms/modalForms.py | 11 +- compensation/models/compensation.py | 30 +- compensation/views/compensation.py | 14 +- compensation/views/eco_account.py | 20 +- compensation/views/payment.py | 4 +- ema/views.py | 18 +- intervention/forms/modalForms.py | 2 + intervention/models/intervention.py | 33 +- intervention/views.py | 18 +- konova/forms.py | 8 +- konova/models/object.py | 15 +- konova/utils/documents.py | 2 +- konova/utils/message_templates.py | 8 +- konova/views.py | 2 +- locale/de/LC_MESSAGES/django.mo | Bin 27805 -> 27644 bytes locale/de/LC_MESSAGES/django.po | 446 ++++++++++++++-------------- user/views.py | 2 +- 18 files changed, 328 insertions(+), 308 deletions(-) diff --git a/compensation/forms/forms.py b/compensation/forms/forms.py index bf4cca2..dbd3c6c 100644 --- a/compensation/forms/forms.py +++ b/compensation/forms/forms.py @@ -18,6 +18,7 @@ from compensation.models import Compensation, EcoAccount from intervention.inputs import GenerateInput from intervention.models import Intervention, Responsibility, Legal from konova.forms import BaseForm, SimpleGeomForm +from konova.utils.message_templates import EDITED_GENERAL_DATA from user.models import UserActionLogEntry @@ -285,7 +286,7 @@ class EditCompensationForm(NewCompensationForm): self.instance.log.add(action) - intervention.mark_as_edited(user) + intervention.mark_as_edited(user, self.request, EDITED_GENERAL_DATA) return self.instance diff --git a/compensation/forms/modalForms.py b/compensation/forms/modalForms.py index 999fc7a..885db95 100644 --- a/compensation/forms/modalForms.py +++ b/compensation/forms/modalForms.py @@ -19,7 +19,8 @@ from compensation.models import CompensationDocument, EcoAccountDocument from konova.contexts import BaseContext from konova.forms import BaseModalForm, NewDocumentForm from konova.models import DeadlineType -from konova.utils.message_templates import FORM_INVALID +from konova.utils.message_templates import FORM_INVALID, ADDED_COMPENSATION_STATE, ADDED_DEADLINE, \ + ADDED_COMPENSATION_ACTION class NewPaymentForm(BaseModalForm): @@ -98,6 +99,7 @@ class NewPaymentForm(BaseModalForm): def save(self): pay = self.instance.add_payment(self) + self.instance.mark_as_edited(self.user, self.request) return pay @@ -147,6 +149,7 @@ class NewStateModalForm(BaseModalForm): def save(self, is_before_state: bool = False): state = self.instance.add_state(self, is_before_state) + self.instance.mark_as_edited(self.user, self.request, ADDED_COMPENSATION_STATE) return state def process_request(self, request: HttpRequest, msg_success: str = _("Object removed"), msg_error: str = FORM_INVALID, redirect_url: str = None): @@ -249,7 +252,8 @@ class NewDeadlineModalForm(BaseModalForm): self.form_caption = _("Insert data for the new deadline") def save(self): - deadline = self.instance.add_new_deadline(self) + deadline = self.instance.add_deadline(self) + self.instance.mark_as_edited(self.user, self.request, ADDED_DEADLINE) return deadline @@ -325,7 +329,8 @@ class NewActionModalForm(BaseModalForm): self.form_caption = _("Insert data for the new action") def save(self): - action = self.instance.add_new_action(self) + action = self.instance.add_action(self) + self.instance.mark_as_edited(self.user, self.request, ADDED_COMPENSATION_ACTION) return action diff --git a/compensation/models/compensation.py b/compensation/models/compensation.py index b9c9499..ccf511a 100644 --- a/compensation/models/compensation.py +++ b/compensation/models/compensation.py @@ -10,6 +10,7 @@ import shutil from django.contrib.auth.models import User from django.db import models, transaction from django.db.models import QuerySet, Sum +from django.http import HttpRequest from django.utils.translation import gettext_lazy as _ from compensation.managers import CompensationManager @@ -45,7 +46,7 @@ class AbstractCompensation(BaseObject): class Meta: abstract = True - def add_new_deadline(self, form) -> Deadline: + def add_deadline(self, form) -> Deadline: """ Adds a new deadline to the abstract compensation Args: @@ -73,7 +74,7 @@ class AbstractCompensation(BaseObject): self.deadlines.add(deadline) return deadline - def add_new_action(self, form) -> CompensationAction: + def add_action(self, form) -> CompensationAction: """ Adds a new action to the compensation Args: @@ -86,8 +87,6 @@ class AbstractCompensation(BaseObject): user = form.user with transaction.atomic(): user_action = UserActionLogEntry.get_created_action(user) - edited_action = UserActionLogEntry.get_edited_action(user, _("Added action")) - comp_action = CompensationAction.objects.create( action_type=form_data["action_type"], amount=form_data["amount"], @@ -95,9 +94,6 @@ class AbstractCompensation(BaseObject): comment=form_data["comment"], created=user_action, ) - self.modified = edited_action - self.save() - self.log.add(edited_action) self.actions.add(comp_action) return comp_action @@ -112,13 +108,7 @@ class AbstractCompensation(BaseObject): """ form_data = form.cleaned_data - user = form.user with transaction.atomic(): - user_action = UserActionLogEntry.get_edited_action(user, _("Added state")) - self.log.add(user_action) - self.modified = user_action - self.save() - state = CompensationState.objects.create( biotope_type=form_data["biotope_type"], surface=form_data["surface"], @@ -271,9 +261,17 @@ class Compensation(AbstractCompensation, CEFMixin, CoherenceMixin): ) return docs - def add_new_action(self, form) -> CompensationAction: - super().add_new_action(form) - self.intervention.set_as_edited(form.user) + def mark_as_edited(self, user: User, request: HttpRequest = None, edit_comment: str = None): + """ Performs internal logic for setting the recordedd/checked state of the related intervention + + Args: + user (User): The performing user + request (HttpRequest): The performing request + + Returns: + + """ + self.intervention.mark_as_edited(user, request, edit_comment) class CompensationDocument(AbstractDocument): diff --git a/compensation/views/compensation.py b/compensation/views/compensation.py index b5bee06..678504e 100644 --- a/compensation/views/compensation.py +++ b/compensation/views/compensation.py @@ -246,7 +246,7 @@ def remove_view(request: HttpRequest, id: str): """ comp = get_object_or_404(Compensation, id=id) - form = RemoveModalForm(request.POST or None, instance=comp, user=request.user) + form = RemoveModalForm(request.POST or None, instance=comp, request=request) return form.process_request( request=request, msg_success=_("Compensation removed"), @@ -267,7 +267,7 @@ def new_document_view(request: HttpRequest, id: str): """ comp = get_object_or_404(Compensation, id=id) - form = NewCompensationDocumentForm(request.POST or None, request.FILES or None, instance=comp, user=request.user) + form = NewCompensationDocumentForm(request.POST or None, request.FILES or None, instance=comp, request=request) return form.process_request( request, msg_success=_("Document added") @@ -336,7 +336,7 @@ def state_new_view(request: HttpRequest, id: str): """ comp = get_object_or_404(Compensation, id=id) - form = NewStateModalForm(request.POST or None, instance=comp, user=request.user) + form = NewStateModalForm(request.POST or None, instance=comp, request=request) return form.process_request( request, msg_success=_("State added") @@ -357,7 +357,7 @@ def action_new_view(request: HttpRequest, id: str): """ comp = get_object_or_404(Compensation, id=id) - form = NewActionModalForm(request.POST or None, instance=comp, user=request.user) + form = NewActionModalForm(request.POST or None, instance=comp, request=request) return form.process_request( request, msg_success=_("Action added") @@ -378,7 +378,7 @@ def deadline_new_view(request: HttpRequest, id: str): """ comp = get_object_or_404(Compensation, id=id) - form = NewDeadlineModalForm(request.POST or None, instance=comp, user=request.user) + form = NewDeadlineModalForm(request.POST or None, instance=comp, request=request) return form.process_request( request, msg_success=_("Deadline added") @@ -400,7 +400,7 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str): """ state = get_object_or_404(CompensationState, id=state_id) - form = RemoveModalForm(request.POST or None, instance=state, user=request.user) + form = RemoveModalForm(request.POST or None, instance=state, request=request) return form.process_request( request, msg_success=_("State removed") @@ -422,7 +422,7 @@ def action_remove_view(request: HttpRequest, id: str, action_id: str): """ action = get_object_or_404(CompensationAction, id=action_id) - form = RemoveModalForm(request.POST or None, instance=action, user=request.user) + form = RemoveModalForm(request.POST or None, instance=action, request=request) return form.process_request( request, msg_success=_("Action removed") diff --git a/compensation/views/eco_account.py b/compensation/views/eco_account.py index ea058bf..7b7d1ea 100644 --- a/compensation/views/eco_account.py +++ b/compensation/views/eco_account.py @@ -250,7 +250,7 @@ def remove_view(request: HttpRequest, id: str): messages.info(request, CANCEL_ACC_RECORDED_OR_DEDUCTED) return redirect("compensation:acc-detail", id=id) - form = RemoveModalForm(request.POST or None, instance=acc, user=request.user) + form = RemoveModalForm(request.POST or None, instance=acc, request=request) return form.process_request( request=request, msg_success=_("Eco-account removed"), @@ -278,7 +278,7 @@ def deduction_remove_view(request: HttpRequest, id: str, deduction_id: str): except ObjectDoesNotExist: raise Http404("Unknown deduction") - form = RemoveModalForm(request.POST or None, instance=eco_deduction, user=request.user) + form = RemoveModalForm(request.POST or None, instance=eco_deduction, request=request) return form.process_request( request=request, msg_success=_("Deduction removed") @@ -325,7 +325,7 @@ def record_view(request: HttpRequest, id:str): """ acc = get_object_or_404(EcoAccount, id=id) - form = RecordModalForm(request.POST or None, instance=acc, user=request.user) + form = RecordModalForm(request.POST or None, instance=acc, request=request) msg_succ = _("{} unrecorded") if acc.recorded else _("{} recorded") msg_succ = msg_succ.format(acc.identifier) return form.process_request( @@ -348,7 +348,7 @@ def state_new_view(request: HttpRequest, id: str): """ acc = get_object_or_404(EcoAccount, id=id) - form = NewStateModalForm(request.POST or None, instance=acc, user=request.user) + form = NewStateModalForm(request.POST or None, instance=acc, request=request) return form.process_request( request, msg_success=_("State added") @@ -369,7 +369,7 @@ def action_new_view(request: HttpRequest, id: str): """ acc = get_object_or_404(EcoAccount, id=id) - form = NewActionModalForm(request.POST or None, instance=acc, user=request.user) + form = NewActionModalForm(request.POST or None, instance=acc, request=request) return form.process_request( request, msg_success=_("Action added") @@ -391,7 +391,7 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str): """ state = get_object_or_404(CompensationState, id=state_id) - form = RemoveModalForm(request.POST or None, instance=state, user=request.user) + form = RemoveModalForm(request.POST or None, instance=state, request=request) return form.process_request( request, msg_success=_("State removed") @@ -413,7 +413,7 @@ def action_remove_view(request: HttpRequest, id: str, action_id: str): """ action = get_object_or_404(CompensationAction, id=action_id) - form = RemoveModalForm(request.POST or None, instance=action, user=request.user) + form = RemoveModalForm(request.POST or None, instance=action, request=request) return form.process_request( request, msg_success=_("Action removed") @@ -434,7 +434,7 @@ def deadline_new_view(request: HttpRequest, id: str): """ acc = get_object_or_404(EcoAccount, id=id) - form = NewDeadlineModalForm(request.POST or None, instance=acc, user=request.user) + form = NewDeadlineModalForm(request.POST or None, instance=acc, request=request) return form.process_request( request, msg_success=_("Deadline added") @@ -454,7 +454,7 @@ def new_document_view(request: HttpRequest, id: str): """ acc = get_object_or_404(EcoAccount, id=id) - form = NewEcoAccountDocumentForm(request.POST or None, request.FILES or None, instance=acc, user=request.user) + form = NewEcoAccountDocumentForm(request.POST or None, request.FILES or None, instance=acc, request=request) return form.process_request( request, msg_success=_("Document added") @@ -524,7 +524,7 @@ def new_deduction_view(request: HttpRequest, id: str): """ acc = get_object_or_404(EcoAccount, id=id) - form = NewDeductionModalForm(request.POST or None, instance=acc, user=request.user) + form = NewDeductionModalForm(request.POST or None, instance=acc, request=request) return form.process_request( request, msg_success=_("Deduction added") diff --git a/compensation/views/payment.py b/compensation/views/payment.py index 8c819fd..99d6d3e 100644 --- a/compensation/views/payment.py +++ b/compensation/views/payment.py @@ -30,7 +30,7 @@ def new_payment_view(request: HttpRequest, intervention_id: str): """ intervention = get_object_or_404(Intervention, id=intervention_id) - form = NewPaymentForm(request.POST or None, instance=intervention, user=request.user) + form = NewPaymentForm(request.POST or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Payment added") @@ -50,7 +50,7 @@ def payment_remove_view(request: HttpRequest, id: str): """ payment = get_object_or_404(Payment, id=id) - form = RemoveModalForm(request.POST or None, instance=payment, user=request.user) + form = RemoveModalForm(request.POST or None, instance=payment, request=request) return form.process_request( request=request, msg_success=_("Payment removed"), diff --git a/ema/views.py b/ema/views.py index 22f6e65..02bf53e 100644 --- a/ema/views.py +++ b/ema/views.py @@ -237,7 +237,7 @@ def remove_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) - form = RemoveModalForm(request.POST or None, instance=ema, user=request.user) + form = RemoveModalForm(request.POST or None, instance=ema, request=request) return form.process_request( request=request, msg_success=_("EMA removed"), @@ -260,7 +260,7 @@ def record_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) msg_succ = _("{} unrecorded") if ema.recorded else _("{} recorded") - form = RecordModalForm(request.POST or None, instance=ema, user=request.user) + form = RecordModalForm(request.POST or None, instance=ema, request=request) return form.process_request( request=request, msg_success=msg_succ.format("EMA"), @@ -281,7 +281,7 @@ def state_new_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) - form = NewStateModalForm(request.POST or None, instance=ema, user=request.user) + form = NewStateModalForm(request.POST or None, instance=ema, request=request) return form.process_request( request, msg_success=_("State added") @@ -302,7 +302,7 @@ def action_new_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) - form = NewActionModalForm(request.POST or None, instance=ema, user=request.user) + form = NewActionModalForm(request.POST or None, instance=ema, request=request) return form.process_request( request, msg_success=_("Action added") @@ -323,7 +323,7 @@ def deadline_new_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) - form = NewDeadlineModalForm(request.POST or None, instance=ema, user=request.user) + form = NewDeadlineModalForm(request.POST or None, instance=ema, request=request) return form.process_request( request, msg_success=_("Deadline added") @@ -343,7 +343,7 @@ def document_new_view(request: HttpRequest, id: str): """ ema = get_object_or_404(Ema, id=id) - form = NewEmaDocumentForm(request.POST or None, request.FILES or None, instance=ema, user=request.user) + form = NewEmaDocumentForm(request.POST or None, request.FILES or None, instance=ema, request=request) return form.process_request( request, msg_success=_("Document added") @@ -413,7 +413,7 @@ def state_remove_view(request: HttpRequest, id: str, state_id: str): """ state = get_object_or_404(CompensationState, id=state_id) - form = RemoveModalForm(request.POST or None, instance=state, user=request.user) + form = RemoveModalForm(request.POST or None, instance=state, request=request) return form.process_request( request, msg_success=_("State removed") @@ -435,7 +435,7 @@ def action_remove_view(request: HttpRequest, id: str, action_id: str): """ action = get_object_or_404(CompensationAction, id=action_id) - form = RemoveModalForm(request.POST or None, instance=action, user=request.user) + form = RemoveModalForm(request.POST or None, instance=action, request=request) return form.process_request( request, msg_success=_("Action removed") @@ -463,7 +463,7 @@ def report_view(request:HttpRequest, id: str): # Prepare data for map viewer geom_form = SimpleGeomForm( - instance=ema + instance=ema, ) qrcode_img = generate_qr_code( request.build_absolute_uri(reverse("ema:report", args=(id,))), diff --git a/intervention/forms/modalForms.py b/intervention/forms/modalForms.py index daa867e..36667f8 100644 --- a/intervention/forms/modalForms.py +++ b/intervention/forms/modalForms.py @@ -169,6 +169,7 @@ class NewRevocationModalForm(BaseModalForm): def save(self): revocation = self.instance.add_revocation(self) + self.instance.mark_as_edited(self.user, self.request) return revocation @@ -332,6 +333,7 @@ class NewDeductionModalForm(BaseModalForm): def save(self): deduction = self.instance.add_deduction(self) + self.instance.mark_as_edited(self.user, self.request) return deduction diff --git a/intervention/models/intervention.py b/intervention/models/intervention.py index 8d28023..fd1a1c2 100644 --- a/intervention/models/intervention.py +++ b/intervention/models/intervention.py @@ -10,7 +10,7 @@ import shutil from django.contrib.auth.models import User from django.db import models, transaction from django.db.models import QuerySet -from django.utils.translation import gettext_lazy as _ +from django.http import HttpRequest from compensation.models import EcoAccountDeduction from intervention.managers import InterventionManager @@ -139,8 +139,7 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec return revoc_docs, regular_docs def set_unchecked(self): - log_entry = super().set_unchecked() - self.add_log_entry_to_compensations(log_entry) + super().set_unchecked() def set_checked(self, user: User) -> UserActionLogEntry: log_entry = super().set_checked(user) @@ -183,8 +182,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec user = form.user with transaction.atomic(): created_action = UserActionLogEntry.get_created_action(user) - edited_action = UserActionLogEntry.get_edited_action(user, _("Added payment")) - pay = Payment.objects.create( created=created_action, amount=form_data.get("amount", -1), @@ -192,10 +189,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec comment=form_data.get("comment", None), intervention=self, ) - self.log.add(edited_action) - self.modified = edited_action - self.save() - self.mark_as_edited(user) return pay def add_revocation(self, form): @@ -211,7 +204,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec user = form.user with transaction.atomic(): created_action = UserActionLogEntry.get_created_action(user) - edited_action = UserActionLogEntry.get_edited_action(user) revocation = Revocation.objects.create( date=form_data["date"], @@ -219,9 +211,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec comment=form_data["comment"], created=created_action, ) - self.modified = edited_action - self.save() - self.log.add(edited_action) if form_data["file"]: RevocationDocument.objects.create( @@ -231,7 +220,6 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec file=form_data["file"], instance=revocation ) - self.mark_as_edited(user) return revocation def add_deduction(self, form): @@ -247,24 +235,16 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec user = form.user with transaction.atomic(): - # Create log entry - user_action_edit = UserActionLogEntry.get_edited_action(user) user_action_create = UserActionLogEntry.get_created_action(user) - - self.log.add(user_action_edit) - self.modified = user_action_edit - self.save() - deduction = EcoAccountDeduction.objects.create( intervention=self, account=form_data["account"], surface=form_data["surface"], created=user_action_create, ) - self.mark_as_edited(user) return deduction - def mark_as_edited(self, performing_user: User): + def mark_as_edited(self, performing_user: User, request: HttpRequest = None, edit_comment: str = None): """ In case the object or a related object changed, internal processes need to be started, such as unrecord and uncheck @@ -274,7 +254,12 @@ class Intervention(BaseObject, ShareableObjectMixin, RecordableObjectMixin, Chec Returns: """ - super().mark_as_edited(performing_user) + user_action_edit = UserActionLogEntry.get_edited_action(performing_user, comment=edit_comment) + self.log.add(user_action_edit) + self.modified = user_action_edit + self.save() + + super().mark_as_edited(performing_user, request) if self.checked: self.set_unchecked() diff --git a/intervention/views.py b/intervention/views.py index 512285b..a3f05f7 100644 --- a/intervention/views.py +++ b/intervention/views.py @@ -123,7 +123,7 @@ def new_document_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = NewInterventionDocumentForm(request.POST or None, request.FILES or None, instance=intervention, user=request.user) + form = NewInterventionDocumentForm(request.POST or None, request.FILES or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Document added") @@ -233,7 +233,7 @@ def detail_view(request: HttpRequest, id: str): is_data_shared = intervention.is_shared_with(user=_user) geom_form = SimpleGeomForm( - instance=intervention + instance=intervention, ) # Inform user about revocation @@ -320,7 +320,7 @@ def remove_view(request: HttpRequest, id: str): """ obj = Intervention.objects.get(id=id) identifier = obj.identifier - form = RemoveModalForm(request.POST or None, instance=obj, user=request.user) + form = RemoveModalForm(request.POST or None, instance=obj, request=request) return form.process_request( request, _("{} removed").format(identifier), @@ -341,7 +341,7 @@ def remove_revocation_view(request: HttpRequest, id: str): """ obj = Revocation.objects.get(id=id) - form = RemoveModalForm(request.POST or None, instance=obj, user=request.user) + form = RemoveModalForm(request.POST or None, instance=obj, request=request) return form.process_request( request, _("Revocation removed"), @@ -402,7 +402,7 @@ def create_share_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = ShareModalForm(request.POST or None, instance=intervention, request=request, user=request.user) + form = ShareModalForm(request.POST or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Share settings updated") @@ -423,7 +423,7 @@ def check_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = CheckModalForm(request.POST or None, instance=intervention, user=request.user) + form = CheckModalForm(request.POST or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Check performed"), @@ -445,7 +445,7 @@ def new_revocation_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = NewRevocationModalForm(request.POST or None, request.FILES or None, instance=intervention, user=request.user) + form = NewRevocationModalForm(request.POST or None, request.FILES or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Revocation added") @@ -492,7 +492,7 @@ def new_deduction_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = NewDeductionModalForm(request.POST or None, instance=intervention, user=request.user) + form = NewDeductionModalForm(request.POST or None, instance=intervention, request=request) return form.process_request( request, msg_success=_("Deduction added") @@ -513,7 +513,7 @@ def record_view(request: HttpRequest, id: str): """ intervention = get_object_or_404(Intervention, id=id) - form = RecordModalForm(request.POST or None, instance=intervention, user=request.user) + form = RecordModalForm(request.POST or None, instance=intervention, request=request) msg_succ = _("{} unrecorded") if intervention.recorded else _("{} recorded") msg_succ = msg_succ.format(intervention.identifier) return form.process_request( diff --git a/konova/forms.py b/konova/forms.py index 8d6fe39..95cf590 100644 --- a/konova/forms.py +++ b/konova/forms.py @@ -14,11 +14,10 @@ from django import forms from django.contrib import messages from django.contrib.auth.models import User from django.contrib.gis.forms import OSMWidget, MultiPolygonField -from django.contrib.gis.geos import Polygon, MultiPolygon +from django.contrib.gis.geos import MultiPolygon from django.db import transaction from django.http import HttpRequest, HttpResponseRedirect from django.shortcuts import render -from django.utils import timezone from django.utils.translation import gettext_lazy as _ from konova.contexts import BaseContext @@ -39,15 +38,16 @@ class BaseForm(forms.Form): cancel_redirect = None form_caption = None instance = None # The data holding model object + request = None form_attrs = {} # Holds additional attributes, that can be used in the template has_required_fields = False # Automatically set. Triggers hint rendering in templates show_cancel_btn = True def __init__(self, *args, **kwargs): self.instance = kwargs.pop("instance", None) - self.user = kwargs.pop("user", None) super().__init__(*args, **kwargs) - + if self.request is not None: + self.user = self.request.user # Check for required fields for _field_name, _field_val in self.fields.items(): if _field_val.required: diff --git a/konova/models/object.py b/konova/models/object.py index 84cb81c..5b8f9b7 100644 --- a/konova/models/object.py +++ b/konova/models/object.py @@ -8,9 +8,10 @@ Created on: 15.11.21 import uuid +from django.contrib import messages from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist -from django.utils import timezone +from django.http import HttpRequest from django.utils.timezone import now from django.db import models, transaction from compensation.settings import COMPENSATION_IDENTIFIER_TEMPLATE, COMPENSATION_IDENTIFIER_LENGTH, \ @@ -19,6 +20,7 @@ from ema.settings import EMA_ACCOUNT_IDENTIFIER_LENGTH, EMA_ACCOUNT_IDENTIFIER_T from intervention.settings import INTERVENTION_IDENTIFIER_LENGTH, INTERVENTION_IDENTIFIER_TEMPLATE from konova.utils import generators from konova.utils.generators import generate_random_string +from konova.utils.message_templates import CHECKED_RECORDED_RESET from user.models import UserActionLogEntry, UserAction @@ -228,7 +230,7 @@ class RecordableObjectMixin(models.Model): self.log.add(action) return action - def mark_as_edited(self, performing_user: User): + def mark_as_edited(self, performing_user: User, request: HttpRequest = None, edit_comment: str = None): """ In case the object or a related object changed, internal processes need to be started, such as unrecord and uncheck @@ -238,9 +240,18 @@ class RecordableObjectMixin(models.Model): Returns: """ + action = UserActionLogEntry.get_edited_action(performing_user, edit_comment) + self.modified = action + self.log.add(action) + self.save() if self.recorded: self.set_unrecorded(performing_user) + if request: + messages.info( + request, + CHECKED_RECORDED_RESET + ) class CheckableObjectMixin(models.Model): diff --git a/konova/utils/documents.py b/konova/utils/documents.py index 695347c..2ce1fee 100644 --- a/konova/utils/documents.py +++ b/konova/utils/documents.py @@ -46,7 +46,7 @@ def remove_document(request: HttpRequest, doc: AbstractDocument): """ title = doc.title - form = RemoveModalForm(request.POST or None, instance=doc, user=request.user) + form = RemoveModalForm(request.POST or None, instance=doc, request=request) return form.process_request( request=request, msg_success=_("Document '{}' deleted").format(title) diff --git a/konova/utils/message_templates.py b/konova/utils/message_templates.py index 7048f2c..5b26c46 100644 --- a/konova/utils/message_templates.py +++ b/konova/utils/message_templates.py @@ -19,4 +19,10 @@ MISSING_GROUP_PERMISSION = _("You need to be part of another user group.") CHECKED_RECORDED_RESET = _("Status of Checked and Recorded reseted") # ECO ACCOUNT -CANCEL_ACC_RECORDED_OR_DEDUCTED = _("Action canceled. Eco account is recorded or deductions exist. Only conservation office member can perform this action.") \ No newline at end of file +CANCEL_ACC_RECORDED_OR_DEDUCTED = _("Action canceled. Eco account is recorded or deductions exist. Only conservation office member can perform this action.") + +# Edited +EDITED_GENERAL_DATA = _("Edited general data") +ADDED_COMPENSATION_STATE = _("Added compensation state") +ADDED_DEADLINE = _("Added deadline") +ADDED_COMPENSATION_ACTION = _("Added compensation action") \ No newline at end of file diff --git a/konova/views.py b/konova/views.py index e1ca2db..c7888ae 100644 --- a/konova/views.py +++ b/konova/views.py @@ -109,7 +109,7 @@ def remove_deadline_view(request: HttpRequest, id:str): """ deadline = get_object_or_404(Deadline, id=id) - form = RemoveModalForm(request.POST or None, instance=deadline, user=request.user) + form = RemoveModalForm(request.POST or None, instance=deadline, request=request) return form.process_request( request, msg_success=_("Deadline removed") diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index 19aafdf15b66d4a86f1026633938f195b28b6f14..d5e0cf26971a00a4f68bdb18be011b046f64a128 100644 GIT binary patch delta 8624 zcmYk>30PNE8prVi0wO2^A})x6Y$A#qU@C5y8xTGfTY5y!Wv6#uU)hM0H za%Ref8OKR0x6-C@+O#G|O)IP!+nm(OY@F}!e_x)5`}FcT=iGD8IrlyHUht{NpUV3lg*wOLOmbDo%6XO3e4#yV+77Jmw6rBI%I6O$=df~4E3WJiKj6N zzp?raY)U;c)wyPvfa;%x8h<#(VzIyOb8eoUxCgb;D&#-6#oCWz1L_}P2%bU>d>*y% zE7$}B)4YKru@Ut&)WW)~^8<=ma*zFOdJ- z*ZgROF&+G=beX7y^)^SM`cFgM*ep~AR-zX25c-swCn@N{S5SL)2-SWLbq80lIW|o9 z?l2y8$62Te@=yckqqbx`YP?z48t=h&_#|rlzoM@DIGz0urSPdWe1*F3d(^~19leai zqArL>r7i`7uq*1$vQY~fhFZv2)Iv(J5iUl}b1y2xl{f+)?nwT7QaDY+gBX+HrFsi$ z0Xs1a51|G=j=H1Ms0ICq8t{hILppgAMVKv6nM*)jpMzS^VAOSmJ_?#>ENYL-F&vj- zV_c28vkj=H_E~G+gL+*LqkpSV6J4?M;XFVZrzNIgGAgqLNEbKN>b@!pg*0qMrSuXi zRaa3dyn$L^WTt0(RLZkZ{f46MWE2jAF&JOA^EIgcuVNe?M&|RmPwm7PsMqWp z)PR?~4(=z^%74Yi7}dqIEh=Lf*aG{YCK!XdeiG`2rkmwhMEy?8!Z$FC`Q2p-IW*kB zwwTkE{leQ&PwQgT9c@A_U>j<}8dU1vL8bm2YKyL76KvAW%Tyd{L7Au<$woe=ZaBv1 z{hv)i57WJ<6|Xa^FpByksE6ix)WENxGPU2@51_958|q8^JKs_X}$o9KIsD5{$23&-ia0O~FS79+$qu!3IsQytsyahK$jhlo` zF$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Yl69Ch6*bc|TXv&5o`4$Abkx9S+w+Cih3H3p5$gVxS**WqSZynw!9dE-qV{}? ztv`g`nPO?`Pulu3s0PoXI=pD>ucEHIZp%MnIm$Qj0lbU)64sx{`qv>DJkfd2r=u<` zwB==3g0dd8WRgC_7vvg!b)B%sYq-f*!0Gp$OQWpseul04hP*NPZmg>P_Z^Ru=v8}* z*gVy` z+7kZ|w}>&saY9E^Zs}$oLq;Nek|oUVm|Rm ziU0TS{afBcr9LM29}}qyCiFZECZ^nX@^kXew)_~^B#=)h7TP+|lX@NVFv&^1Z%1cu zJ@X$XqR@4`AZDaP)c>p~O~Z&GfiYl#edO(Aw6 z(p1lpPrOq+r)GHZ@|vYRvnl;Zq!XivR6^gu2f2Ery<@I*s+H5`1O4ELpsqd3-cZlJ{OT=noCefRSBd+>hv1AGjxFH2~tR=o8@~C?T_YotB>V%Ff zL=B=G=Y2;g`6>#}68(vXh$__mfE|h3gqwJnI{mRwq`DWOyRmF#98u(usoI|+~m=y<1(TC&1hl;(Snl|iJw); z(Vu(>p`#miB)m6J4!89+tVPt7C(k67lCLB_CYlg!s7oR4k?UwmZ1H9^cbMckq81m- z#oBlVn-j6bMxq{dzM}`pBFZCdMZ7f&>rg)fClW)+YvU4oZ+kpKxgDWn9OZ|7(`iga zjej@HCDVlg-D!IyV*sN31EOxoC-@sqQQvm@$Nai_bcq|KV-&dxF2)6*$U z&q>R1?, YEAR. # -#: compensation/filters.py:71 compensation/forms/modalForms.py:35 -#: compensation/forms/modalForms.py:46 compensation/forms/modalForms.py:62 -#: compensation/forms/modalForms.py:273 compensation/forms/modalForms.py:368 +#: compensation/filters.py:71 compensation/forms/modalForms.py:34 +#: compensation/forms/modalForms.py:45 compensation/forms/modalForms.py:61 +#: compensation/forms/modalForms.py:238 compensation/forms/modalForms.py:316 #: intervention/filters.py:26 intervention/filters.py:40 #: intervention/filters.py:47 intervention/filters.py:48 -#: intervention/forms/forms.py:53 intervention/forms/forms.py:155 -#: intervention/forms/forms.py:167 intervention/forms/modalForms.py:133 -#: intervention/forms/modalForms.py:146 intervention/forms/modalForms.py:159 -#: konova/forms.py:142 konova/forms.py:247 konova/forms.py:313 -#: konova/forms.py:340 konova/forms.py:350 konova/forms.py:363 -#: konova/forms.py:375 konova/forms.py:396 user/forms.py:38 +#: intervention/forms/forms.py:52 intervention/forms/forms.py:154 +#: intervention/forms/forms.py:166 intervention/forms/modalForms.py:125 +#: intervention/forms/modalForms.py:138 intervention/forms/modalForms.py:151 +#: konova/forms.py:139 konova/forms.py:240 konova/forms.py:306 +#: konova/forms.py:333 konova/forms.py:343 konova/forms.py:356 +#: konova/forms.py:368 konova/forms.py:386 user/forms.py:38 #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-15 15:48+0100\n" +"POT-Creation-Date: 2021-11-17 14:27+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,26 +37,26 @@ msgstr "Vom" msgid "To" msgstr "Bis" -#: analysis/forms.py:47 compensation/forms/forms.py:76 +#: analysis/forms.py:47 compensation/forms/forms.py:77 #: compensation/templates/compensation/detail/eco_account/view.html:58 #: compensation/templates/compensation/report/eco_account/report.html:16 #: compensation/utils/quality.py:100 ema/templates/ema/detail/view.html:42 #: ema/templates/ema/report/report.html:16 ema/utils/quality.py:26 -#: intervention/forms/forms.py:101 +#: intervention/forms/forms.py:100 #: intervention/templates/intervention/detail/view.html:56 #: intervention/templates/intervention/report/report.html:37 #: intervention/utils/quality.py:49 msgid "Conservation office" msgstr "Eintragungsstelle" -#: analysis/forms.py:49 compensation/forms/forms.py:78 +#: analysis/forms.py:49 compensation/forms/forms.py:79 msgid "Select the responsible office" msgstr "Verantwortliche Stelle" -#: analysis/forms.py:58 compensation/forms/forms.py:87 -#: compensation/forms/forms.py:164 intervention/forms/forms.py:63 -#: intervention/forms/forms.py:80 intervention/forms/forms.py:96 -#: intervention/forms/forms.py:112 intervention/forms/modalForms.py:47 +#: analysis/forms.py:58 compensation/forms/forms.py:88 +#: compensation/forms/forms.py:165 intervention/forms/forms.py:62 +#: intervention/forms/forms.py:79 intervention/forms/forms.py:95 +#: intervention/forms/forms.py:111 intervention/forms/modalForms.py:45 msgid "Click for selection" msgstr "Auswählen..." @@ -68,7 +68,7 @@ msgstr "Bericht generieren" msgid "Select a timespan and the desired conservation office" msgstr "Wählen Sie die Zeitspanne und die gewünschte Eintragungsstelle" -#: analysis/forms.py:69 konova/forms.py:194 +#: analysis/forms.py:69 konova/forms.py:187 msgid "Continue" msgstr "Weiter" @@ -88,7 +88,7 @@ msgstr "" #: analysis/templates/analysis/reports/includes/eco_account/amount.html:3 #: analysis/templates/analysis/reports/includes/intervention/amount.html:3 #: analysis/templates/analysis/reports/includes/old_data/amount.html:3 -#: compensation/forms/modalForms.py:351 +#: compensation/forms/modalForms.py:299 #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:34 #: intervention/templates/intervention/detail/includes/deductions.html:31 msgid "Amount" @@ -132,7 +132,8 @@ msgstr "Zuständigkeitsbereich" #: compensation/tables.py:35 #: compensation/templates/compensation/detail/compensation/view.html:63 #: intervention/tables.py:33 -#: intervention/templates/intervention/detail/view.html:68 user/models.py:48 +#: intervention/templates/intervention/detail/view.html:68 +#: user/models/user_action.py:19 msgid "Checked" msgstr "Geprüft" @@ -150,7 +151,8 @@ msgstr "Geprüft" #: compensation/templates/compensation/detail/eco_account/view.html:44 #: ema/tables.py:38 ema/templates/ema/detail/view.html:28 #: intervention/tables.py:39 -#: intervention/templates/intervention/detail/view.html:82 user/models.py:49 +#: intervention/templates/intervention/detail/view.html:82 +#: user/models/user_action.py:20 msgid "Recorded" msgstr "Verzeichnet" @@ -203,14 +205,14 @@ msgstr "Abbuchungen" #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:9 #: analysis/templates/analysis/reports/includes/eco_account/deductions.html:11 -#: compensation/forms/modalForms.py:152 +#: compensation/forms/modalForms.py:133 #: compensation/templates/compensation/detail/compensation/includes/states-after.html:36 #: compensation/templates/compensation/detail/compensation/includes/states-before.html:36 #: compensation/templates/compensation/detail/eco_account/includes/states-after.html:36 #: compensation/templates/compensation/detail/eco_account/includes/states-before.html:36 #: ema/templates/ema/detail/includes/states-after.html:36 #: ema/templates/ema/detail/includes/states-before.html:36 -#: intervention/forms/modalForms.py:301 +#: intervention/forms/modalForms.py:258 msgid "Surface" msgstr "Fläche" @@ -236,7 +238,7 @@ msgid "Compensation" msgstr "Kompensation" #: analysis/templates/analysis/reports/includes/intervention/compensated_by.html:21 -#: compensation/forms/modalForms.py:75 +#: compensation/forms/modalForms.py:74 msgid "Payment" msgstr "Zahlung" @@ -259,7 +261,7 @@ msgstr "" " " #: analysis/templates/analysis/reports/includes/intervention/laws.html:14 -#: intervention/forms/forms.py:68 +#: intervention/forms/forms.py:67 #: intervention/templates/intervention/detail/view.html:39 #: intervention/templates/intervention/report/report.html:20 msgid "Law" @@ -273,7 +275,7 @@ msgid "Type" msgstr "Typ" #: analysis/templates/analysis/reports/includes/old_data/amount.html:24 -#: intervention/forms/modalForms.py:312 intervention/forms/modalForms.py:319 +#: intervention/forms/modalForms.py:269 intervention/forms/modalForms.py:276 #: intervention/tables.py:88 #: intervention/templates/intervention/detail/view.html:19 #: konova/templates/konova/home.html:11 templates/navbars/navbar.html:22 @@ -283,7 +285,7 @@ msgstr "Eingriff" #: analysis/templates/analysis/reports/includes/old_data/amount.html:34 #: compensation/tables.py:224 #: compensation/templates/compensation/detail/eco_account/view.html:19 -#: intervention/forms/modalForms.py:285 intervention/forms/modalForms.py:292 +#: intervention/forms/modalForms.py:242 intervention/forms/modalForms.py:249 #: konova/templates/konova/home.html:88 templates/navbars/navbar.html:34 msgid "Eco-account" msgstr "Ökokonto" @@ -300,18 +302,18 @@ msgstr "Vor" msgid "Show only unrecorded" msgstr "Nur unverzeichnete anzeigen" -#: compensation/forms/forms.py:31 compensation/tables.py:25 -#: compensation/tables.py:166 ema/tables.py:28 intervention/forms/forms.py:27 +#: compensation/forms/forms.py:32 compensation/tables.py:25 +#: compensation/tables.py:166 ema/tables.py:28 intervention/forms/forms.py:26 #: intervention/tables.py:23 #: intervention/templates/intervention/detail/includes/compensations.html:30 msgid "Identifier" msgstr "Kennung" -#: compensation/forms/forms.py:34 intervention/forms/forms.py:30 +#: compensation/forms/forms.py:35 intervention/forms/forms.py:29 msgid "Generated automatically" msgstr "Automatisch generiert" -#: compensation/forms/forms.py:43 compensation/tables.py:30 +#: compensation/forms/forms.py:44 compensation/tables.py:30 #: compensation/tables.py:171 #: compensation/templates/compensation/detail/compensation/includes/documents.html:28 #: compensation/templates/compensation/detail/compensation/view.html:31 @@ -321,26 +323,26 @@ msgstr "Automatisch generiert" #: compensation/templates/compensation/report/eco_account/report.html:12 #: ema/tables.py:33 ema/templates/ema/detail/includes/documents.html:28 #: ema/templates/ema/detail/view.html:24 -#: ema/templates/ema/report/report.html:12 intervention/forms/forms.py:39 +#: ema/templates/ema/report/report.html:12 intervention/forms/forms.py:38 #: intervention/tables.py:28 #: intervention/templates/intervention/detail/includes/compensations.html:33 #: intervention/templates/intervention/detail/includes/documents.html:28 #: intervention/templates/intervention/detail/view.html:31 #: intervention/templates/intervention/report/report.html:12 -#: konova/forms.py:339 +#: konova/forms.py:332 msgid "Title" msgstr "Bezeichnung" -#: compensation/forms/forms.py:45 intervention/forms/forms.py:41 +#: compensation/forms/forms.py:46 intervention/forms/forms.py:40 msgid "An explanatory name" msgstr "Aussagekräftiger Titel" -#: compensation/forms/forms.py:49 ema/forms.py:49 ema/forms.py:105 +#: compensation/forms/forms.py:50 ema/forms.py:49 ema/forms.py:102 msgid "Compensation XY; Location ABC" msgstr "Kompensation XY; Flur ABC" -#: compensation/forms/forms.py:56 compensation/forms/modalForms.py:61 -#: compensation/forms/modalForms.py:272 compensation/forms/modalForms.py:367 +#: compensation/forms/forms.py:57 compensation/forms/modalForms.py:60 +#: compensation/forms/modalForms.py:237 compensation/forms/modalForms.py:315 #: compensation/templates/compensation/detail/compensation/includes/actions.html:34 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:34 #: compensation/templates/compensation/detail/compensation/includes/documents.html:31 @@ -350,212 +352,199 @@ msgstr "Kompensation XY; Flur ABC" #: ema/templates/ema/detail/includes/actions.html:34 #: ema/templates/ema/detail/includes/deadlines.html:34 #: ema/templates/ema/detail/includes/documents.html:31 -#: intervention/forms/forms.py:179 intervention/forms/modalForms.py:158 +#: intervention/forms/forms.py:178 intervention/forms/modalForms.py:150 #: intervention/templates/intervention/detail/includes/documents.html:31 #: intervention/templates/intervention/detail/includes/payments.html:34 #: intervention/templates/intervention/detail/includes/revocation.html:38 -#: konova/forms.py:374 konova/templates/konova/comment_card.html:16 +#: konova/forms.py:367 konova/templates/konova/comment_card.html:16 msgid "Comment" msgstr "Kommentar" -#: compensation/forms/forms.py:58 intervention/forms/forms.py:181 +#: compensation/forms/forms.py:59 intervention/forms/forms.py:180 msgid "Additional comment" msgstr "Zusätzlicher Kommentar" -#: compensation/forms/forms.py:92 +#: compensation/forms/forms.py:93 #: compensation/templates/compensation/detail/eco_account/view.html:62 #: compensation/templates/compensation/report/eco_account/report.html:20 #: compensation/utils/quality.py:102 ema/templates/ema/detail/view.html:46 #: ema/templates/ema/report/report.html:20 ema/utils/quality.py:28 -#: intervention/forms/forms.py:129 +#: intervention/forms/forms.py:128 #: intervention/templates/intervention/detail/view.html:60 #: intervention/templates/intervention/report/report.html:41 #: intervention/utils/quality.py:42 msgid "Conservation office file number" msgstr "Aktenzeichen Eintragungsstelle" -#: compensation/forms/forms.py:98 intervention/forms/forms.py:135 +#: compensation/forms/forms.py:99 intervention/forms/forms.py:134 msgid "ETS-123/ABC.456" msgstr "" -#: compensation/forms/forms.py:104 +#: compensation/forms/forms.py:105 msgid "Eco-account handler" msgstr "Maßnahmenträger" -#: compensation/forms/forms.py:108 +#: compensation/forms/forms.py:109 msgid "Who handles the eco-account" msgstr "Wer für die Herrichtung des Ökokontos verantwortlich ist" -#: compensation/forms/forms.py:111 intervention/forms/forms.py:148 +#: compensation/forms/forms.py:112 intervention/forms/forms.py:147 msgid "Company Mustermann" msgstr "Firma Mustermann" -#: compensation/forms/forms.py:124 +#: compensation/forms/forms.py:125 msgid "Is CEF" msgstr "Ist CEF-Maßnahme" -#: compensation/forms/forms.py:125 +#: compensation/forms/forms.py:126 msgid "Optionally: Whether this compensation is a CEF compensation?" msgstr "Optional: Handelt es sich um eine CEF-Maßnahme?" -#: compensation/forms/forms.py:137 +#: compensation/forms/forms.py:138 msgid "Is coherence keeping" msgstr "Ist Kohärenzsicherungsmaßnahme" -#: compensation/forms/forms.py:138 +#: compensation/forms/forms.py:139 msgid "" "Optionally: Whether this compensation is a coherence keeping compensation?" -msgstr "" -"Optional: Handelt es sich um eine Kohärenzsicherungsmaßnahme?" +msgstr "Optional: Handelt es sich um eine Kohärenzsicherungsmaßnahme?" -#: compensation/forms/forms.py:155 +#: compensation/forms/forms.py:156 #: compensation/templates/compensation/detail/compensation/view.html:35 #: compensation/templates/compensation/report/compensation/report.html:16 msgid "compensates intervention" msgstr "kompensiert Eingriff" -#: compensation/forms/forms.py:157 +#: compensation/forms/forms.py:158 msgid "Select the intervention for which this compensation compensates" msgstr "Wählen Sie den Eingriff, für den diese Kompensation bestimmt ist" -#: compensation/forms/forms.py:183 +#: compensation/forms/forms.py:184 msgid "New compensation" msgstr "Neue Kompensation" -#: compensation/forms/forms.py:243 +#: compensation/forms/forms.py:241 msgid "Edit compensation" msgstr "Bearbeite Kompensation" -#: compensation/forms/forms.py:305 compensation/utils/quality.py:84 +#: compensation/forms/forms.py:302 compensation/utils/quality.py:84 msgid "Available Surface" msgstr "Verfügbare Fläche" -#: compensation/forms/forms.py:308 +#: compensation/forms/forms.py:305 msgid "The amount that can be used for deductions" msgstr "Die für Abbuchungen zur Verfügung stehende Menge" -#: compensation/forms/forms.py:317 +#: compensation/forms/forms.py:314 #: compensation/templates/compensation/detail/eco_account/view.html:66 #: compensation/utils/quality.py:72 msgid "Agreement date" msgstr "Vereinbarungsdatum" -#: compensation/forms/forms.py:319 +#: compensation/forms/forms.py:316 msgid "When did the parties agree on this?" msgstr "Wann wurde dieses Ökokonto offiziell vereinbart?" -#: compensation/forms/forms.py:343 +#: compensation/forms/forms.py:340 msgid "New Eco-Account" msgstr "Neues Ökokonto" -#: compensation/forms/forms.py:352 +#: compensation/forms/forms.py:349 msgid "Eco-Account XY; Location ABC" msgstr "Ökokonto XY; Flur ABC" -#: compensation/forms/forms.py:409 +#: compensation/forms/forms.py:403 msgid "Edit Eco-Account" msgstr "Ökokonto bearbeiten" -#: compensation/forms/modalForms.py:36 +#: compensation/forms/modalForms.py:35 msgid "in Euro" msgstr "in Euro" -#: compensation/forms/modalForms.py:45 +#: compensation/forms/modalForms.py:44 #: intervention/templates/intervention/detail/includes/payments.html:31 msgid "Due on" msgstr "Fällig am" -#: compensation/forms/modalForms.py:48 +#: compensation/forms/modalForms.py:47 msgid "Due on which date" msgstr "Zahlung wird an diesem Datum erwartet" -#: compensation/forms/modalForms.py:63 compensation/forms/modalForms.py:274 -#: compensation/forms/modalForms.py:369 intervention/forms/modalForms.py:160 -#: konova/forms.py:376 +#: compensation/forms/modalForms.py:62 compensation/forms/modalForms.py:239 +#: compensation/forms/modalForms.py:317 intervention/forms/modalForms.py:152 +#: konova/forms.py:369 msgid "Additional comment, maximum {} letters" msgstr "Zusätzlicher Kommentar, maximal {} Zeichen" -#: compensation/forms/modalForms.py:76 +#: compensation/forms/modalForms.py:75 msgid "Add a payment for intervention '{}'" msgstr "Neue Ersatzzahlung zu Eingriff '{}' hinzufügen" -#: compensation/forms/modalForms.py:96 +#: compensation/forms/modalForms.py:95 msgid "If there is no date you can enter, please explain why." msgstr "Falls Sie kein Datum angeben können, erklären Sie bitte weshalb." -#: compensation/forms/modalForms.py:110 -msgid "Added payment" -msgstr "Zahlung hinzufügen" - -#: compensation/forms/modalForms.py:133 compensation/forms/modalForms.py:145 +#: compensation/forms/modalForms.py:114 compensation/forms/modalForms.py:126 msgid "Biotope Type" msgstr "Biotoptyp" -#: compensation/forms/modalForms.py:136 +#: compensation/forms/modalForms.py:117 msgid "Select the biotope type" msgstr "Biotoptyp wählen" -#: compensation/forms/modalForms.py:155 intervention/forms/modalForms.py:303 +#: compensation/forms/modalForms.py:136 intervention/forms/modalForms.py:260 msgid "in m²" msgstr "" -#: compensation/forms/modalForms.py:166 +#: compensation/forms/modalForms.py:147 msgid "New state" msgstr "Neuer Zustand" -#: compensation/forms/modalForms.py:167 +#: compensation/forms/modalForms.py:148 msgid "Insert data for the new state" msgstr "Geben Sie die Daten des neuen Zustandes ein" -#: compensation/forms/modalForms.py:174 -msgid "Added state" -msgstr "Zustand hinzugefügt" - -#: compensation/forms/modalForms.py:190 konova/forms.py:196 +#: compensation/forms/modalForms.py:155 konova/forms.py:189 msgid "Object removed" msgstr "Objekt entfernt" -#: compensation/forms/modalForms.py:244 +#: compensation/forms/modalForms.py:209 msgid "Deadline Type" msgstr "Fristart" -#: compensation/forms/modalForms.py:247 +#: compensation/forms/modalForms.py:212 msgid "Select the deadline type" msgstr "Fristart wählen" -#: compensation/forms/modalForms.py:256 +#: compensation/forms/modalForms.py:221 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:31 #: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31 #: ema/templates/ema/detail/includes/deadlines.html:31 -#: intervention/forms/modalForms.py:132 +#: intervention/forms/modalForms.py:124 msgid "Date" msgstr "Datum" -#: compensation/forms/modalForms.py:259 +#: compensation/forms/modalForms.py:224 msgid "Select date" msgstr "Datum wählen" -#: compensation/forms/modalForms.py:286 +#: compensation/forms/modalForms.py:251 msgid "New deadline" msgstr "Neue Frist" -#: compensation/forms/modalForms.py:287 +#: compensation/forms/modalForms.py:252 msgid "Insert data for the new deadline" msgstr "Geben Sie die Daten der neuen Frist ein" -#: compensation/forms/modalForms.py:304 -msgid "Added deadline" -msgstr "Frist/Termin hinzugefügt" - -#: compensation/forms/modalForms.py:322 +#: compensation/forms/modalForms.py:270 msgid "Action Type" msgstr "Maßnahmentyp" -#: compensation/forms/modalForms.py:325 +#: compensation/forms/modalForms.py:273 msgid "Select the action type" msgstr "Maßnahmentyp wählen" -#: compensation/forms/modalForms.py:334 +#: compensation/forms/modalForms.py:282 #: compensation/templates/compensation/detail/compensation/includes/actions.html:38 #: compensation/templates/compensation/detail/compensation/includes/deadlines.html:38 #: compensation/templates/compensation/detail/compensation/includes/documents.html:35 @@ -581,62 +570,62 @@ msgstr "Maßnahmentyp wählen" msgid "Action" msgstr "Aktionen" -#: compensation/forms/modalForms.py:339 +#: compensation/forms/modalForms.py:287 msgid "Unit" msgstr "Einheit" -#: compensation/forms/modalForms.py:342 +#: compensation/forms/modalForms.py:290 msgid "Select the unit" msgstr "Einheit wählen" -#: compensation/forms/modalForms.py:354 +#: compensation/forms/modalForms.py:302 msgid "Insert the amount" msgstr "Menge eingeben" -#: compensation/forms/modalForms.py:380 +#: compensation/forms/modalForms.py:328 msgid "New action" msgstr "Neue Maßnahme" -#: compensation/forms/modalForms.py:381 +#: compensation/forms/modalForms.py:329 msgid "Insert data for the new action" msgstr "Geben Sie die Daten der neuen Maßnahme ein" -#: compensation/forms/modalForms.py:399 -msgid "Added action" -msgstr "Maßnahme hinzugefügt" - -#: compensation/models.py:81 +#: compensation/models/action.py:21 msgid "cm" msgstr "" -#: compensation/models.py:82 +#: compensation/models/action.py:22 msgid "m" msgstr "" -#: compensation/models.py:83 +#: compensation/models/action.py:23 msgid "km" msgstr "" -#: compensation/models.py:84 +#: compensation/models/action.py:24 msgid "m²" msgstr "" -#: compensation/models.py:85 +#: compensation/models/action.py:25 msgid "ha" msgstr "" -#: compensation/models.py:86 +#: compensation/models/action.py:26 msgid "Pieces" msgstr "Stück" -#: compensation/models.py:374 +#: compensation/models/compensation.py:62 konova/utils/message_templates.py:27 +msgid "Added deadline" +msgstr "Frist/Termin hinzugefügt" + +#: compensation/models/eco_account.py:55 msgid "" "Deductable surface can not be larger than existing surfaces in after states" msgstr "" "Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht " "überschreiten" -#: compensation/models.py:381 +#: compensation/models/eco_account.py:62 msgid "" "Deductable surface can not be smaller than the sum of already existing " "deductions. Please contact the responsible users for the deductions!" @@ -804,7 +793,7 @@ msgstr "Dokumente" #: compensation/templates/compensation/detail/eco_account/includes/documents.html:14 #: ema/templates/ema/detail/includes/documents.html:14 #: intervention/templates/intervention/detail/includes/documents.html:14 -#: konova/forms.py:395 +#: konova/forms.py:385 msgid "Add new document" msgstr "Neues Dokument hinzufügen" @@ -875,6 +864,18 @@ msgstr "Fehlende Flächenmengen laut Zielzustand: " msgid "Is CEF compensation" msgstr "Ist CEF Maßnahme" +#: compensation/templates/compensation/detail/compensation/view.html:46 +#: compensation/templates/compensation/detail/compensation/view.html:56 +#: venv/lib/python3.7/site-packages/django/forms/widgets.py:710 +msgid "Yes" +msgstr "" + +#: compensation/templates/compensation/detail/compensation/view.html:48 +#: compensation/templates/compensation/detail/compensation/view.html:58 +#: venv/lib/python3.7/site-packages/django/forms/widgets.py:711 +msgid "No" +msgstr "" + #: compensation/templates/compensation/detail/compensation/view.html:53 msgid "Is Coherence keeping compensation" msgstr "Ist Kohärenzsicherungsmaßnahme" @@ -914,14 +915,14 @@ msgstr "Zuletzt bearbeitet" #: compensation/templates/compensation/detail/compensation/view.html:99 #: compensation/templates/compensation/detail/eco_account/view.html:82 -#: ema/templates/ema/detail/view.html:69 intervention/forms/modalForms.py:54 +#: ema/templates/ema/detail/view.html:69 intervention/forms/modalForms.py:52 #: intervention/templates/intervention/detail/view.html:116 msgid "Shared with" msgstr "Freigegeben für" #: compensation/templates/compensation/detail/eco_account/includes/controls.html:15 #: ema/templates/ema/detail/includes/controls.html:15 -#: intervention/forms/modalForms.py:68 +#: intervention/forms/modalForms.py:66 #: intervention/templates/intervention/detail/includes/controls.html:15 msgid "Share" msgstr "Freigabe" @@ -954,7 +955,7 @@ msgstr "Eingriffskennung" #: compensation/templates/compensation/detail/eco_account/includes/deductions.html:37 #: intervention/templates/intervention/detail/includes/deductions.html:34 -#: user/models.py:51 +#: user/models/user_action.py:22 msgid "Created" msgstr "Erstellt" @@ -1047,110 +1048,108 @@ msgstr "" msgid "Responsible data" msgstr "Daten zu den verantwortlichen Stellen" -#: compensation/views/compensation_views.py:77 +#: compensation/views/compensation.py:79 msgid "Compensation {} added" msgstr "Kompensation {} hinzugefügt" -#: compensation/views/compensation_views.py:134 +#: compensation/views/compensation.py:143 msgid "Compensation {} edited" msgstr "Kompensation {} bearbeitet" -#: compensation/views/compensation_views.py:220 -#: compensation/views/eco_account_views.py:307 ema/views.py:182 -#: intervention/views.py:475 +#: compensation/views/compensation.py:229 compensation/views/eco_account.py:308 +#: ema/views.py:182 intervention/views.py:475 msgid "Log" msgstr "Log" -#: compensation/views/compensation_views.py:243 +#: compensation/views/compensation.py:252 msgid "Compensation removed" msgstr "Kompensation entfernt" -#: compensation/views/compensation_views.py:264 -#: compensation/views/eco_account_views.py:459 ema/views.py:349 -#: intervention/views.py:129 +#: compensation/views/compensation.py:273 compensation/views/eco_account.py:460 +#: ema/views.py:349 intervention/views.py:129 msgid "Document added" msgstr "Dokument hinzugefügt" -#: compensation/views/compensation_views.py:333 -#: compensation/views/eco_account_views.py:353 ema/views.py:287 +#: compensation/views/compensation.py:342 compensation/views/eco_account.py:354 +#: ema/views.py:287 msgid "State added" msgstr "Zustand hinzugefügt" -#: compensation/views/compensation_views.py:354 -#: compensation/views/eco_account_views.py:374 ema/views.py:308 +#: compensation/views/compensation.py:363 compensation/views/eco_account.py:375 +#: ema/views.py:308 msgid "Action added" msgstr "Maßnahme hinzugefügt" -#: compensation/views/compensation_views.py:375 -#: compensation/views/eco_account_views.py:439 ema/views.py:329 +#: compensation/views/compensation.py:384 compensation/views/eco_account.py:440 +#: ema/views.py:329 msgid "Deadline added" msgstr "Frist/Termin hinzugefügt" -#: compensation/views/compensation_views.py:397 -#: compensation/views/eco_account_views.py:396 ema/views.py:419 +#: compensation/views/compensation.py:406 compensation/views/eco_account.py:397 +#: ema/views.py:419 msgid "State removed" msgstr "Zustand gelöscht" -#: compensation/views/compensation_views.py:419 -#: compensation/views/eco_account_views.py:418 ema/views.py:441 +#: compensation/views/compensation.py:428 compensation/views/eco_account.py:419 +#: ema/views.py:441 msgid "Action removed" msgstr "Maßnahme entfernt" -#: compensation/views/eco_account_views.py:88 +#: compensation/views/eco_account.py:89 msgid "Eco-Account {} added" msgstr "Ökokonto {} hinzugefügt" -#: compensation/views/eco_account_views.py:145 +#: compensation/views/eco_account.py:146 msgid "Eco-Account {} edited" msgstr "Ökokonto {} bearbeitet" -#: compensation/views/eco_account_views.py:255 +#: compensation/views/eco_account.py:256 msgid "Eco-account removed" msgstr "Ökokonto entfernt" -#: compensation/views/eco_account_views.py:283 +#: compensation/views/eco_account.py:284 msgid "Deduction removed" msgstr "Abbuchung entfernt" -#: compensation/views/eco_account_views.py:328 ema/views.py:262 +#: compensation/views/eco_account.py:329 ema/views.py:262 #: intervention/views.py:517 msgid "{} unrecorded" msgstr "{} entzeichnet" -#: compensation/views/eco_account_views.py:328 ema/views.py:262 +#: compensation/views/eco_account.py:329 ema/views.py:262 #: intervention/views.py:517 msgid "{} recorded" msgstr "{} verzeichnet" -#: compensation/views/eco_account_views.py:529 intervention/views.py:498 +#: compensation/views/eco_account.py:530 intervention/views.py:498 msgid "Deduction added" msgstr "Abbuchung hinzugefügt" -#: compensation/views/eco_account_views.py:612 ema/views.py:517 +#: compensation/views/eco_account.py:613 ema/views.py:517 #: intervention/views.py:373 msgid "{} has already been shared with you" msgstr "{} wurde bereits für Sie freigegeben" -#: compensation/views/eco_account_views.py:617 ema/views.py:522 +#: compensation/views/eco_account.py:618 ema/views.py:522 #: intervention/views.py:378 msgid "{} has been shared with you" msgstr "{} ist nun für Sie freigegeben" -#: compensation/views/eco_account_views.py:624 ema/views.py:529 +#: compensation/views/eco_account.py:625 ema/views.py:529 #: intervention/views.py:385 msgid "Share link invalid" msgstr "Freigabelink ungültig" -#: compensation/views/eco_account_views.py:647 ema/views.py:552 +#: compensation/views/eco_account.py:648 ema/views.py:552 #: intervention/views.py:408 msgid "Share settings updated" msgstr "Freigabe Einstellungen aktualisiert" -#: compensation/views/payment_views.py:36 +#: compensation/views/payment.py:36 msgid "Payment added" msgstr "Zahlung hinzugefügt" -#: compensation/views/payment_views.py:56 +#: compensation/views/payment.py:56 msgid "Payment removed" msgstr "Zahlung gelöscht" @@ -1158,7 +1157,7 @@ msgstr "Zahlung gelöscht" msgid "New EMA" msgstr "Neue EMA hinzufügen" -#: ema/forms.py:99 +#: ema/forms.py:96 msgid "Edit EMA" msgstr "Bearbeite EMA" @@ -1210,84 +1209,84 @@ msgstr "Gemarkung" msgid "Search for district" msgstr "Nach Gemarkung suchen" -#: intervention/forms/forms.py:45 +#: intervention/forms/forms.py:44 msgid "Construction XY; Location ABC" msgstr "Bauvorhaben XY; Flur ABC" -#: intervention/forms/forms.py:51 +#: intervention/forms/forms.py:50 #: intervention/templates/intervention/detail/view.html:35 #: intervention/templates/intervention/report/report.html:16 #: intervention/utils/quality.py:82 msgid "Process type" msgstr "Verfahrenstyp" -#: intervention/forms/forms.py:70 +#: intervention/forms/forms.py:69 msgid "Multiple selection possible" msgstr "Mehrfachauswahl möglich" -#: intervention/forms/forms.py:85 +#: intervention/forms/forms.py:84 #: intervention/templates/intervention/detail/view.html:48 #: intervention/templates/intervention/report/report.html:29 #: intervention/utils/quality.py:46 msgid "Registration office" msgstr "Zulassungsbehörde" -#: intervention/forms/forms.py:117 +#: intervention/forms/forms.py:116 #: intervention/templates/intervention/detail/view.html:52 #: intervention/templates/intervention/report/report.html:33 #: intervention/utils/quality.py:39 msgid "Registration office file number" msgstr "Aktenzeichen Zulassungsbehörde" -#: intervention/forms/forms.py:123 +#: intervention/forms/forms.py:122 msgid "ZB-123/ABC.456" msgstr "" -#: intervention/forms/forms.py:141 +#: intervention/forms/forms.py:140 #: intervention/templates/intervention/detail/view.html:64 #: intervention/templates/intervention/report/report.html:45 #: intervention/utils/quality.py:52 msgid "Intervention handler" msgstr "Eingriffsverursacher" -#: intervention/forms/forms.py:145 +#: intervention/forms/forms.py:144 msgid "Who performs the intervention" msgstr "Wer führt den Eingriff durch" -#: intervention/forms/forms.py:154 +#: intervention/forms/forms.py:153 #: intervention/templates/intervention/detail/view.html:96 #: intervention/templates/intervention/report/report.html:83 #: intervention/utils/quality.py:73 msgid "Registration date" msgstr "Datum Zulassung bzw. Satzungsbeschluss" -#: intervention/forms/forms.py:166 +#: intervention/forms/forms.py:165 #: intervention/templates/intervention/detail/view.html:100 #: intervention/templates/intervention/report/report.html:87 msgid "Binding on" msgstr "Datum Bestandskraft" -#: intervention/forms/forms.py:192 +#: intervention/forms/forms.py:191 msgid "New intervention" msgstr "Neuer Eingriff" -#: intervention/forms/forms.py:273 +#: intervention/forms/forms.py:269 msgid "Edit intervention" msgstr "Eingriff bearbeiten" -#: intervention/forms/modalForms.py:27 +#: intervention/forms/modalForms.py:25 msgid "Share link" msgstr "Freigabelink" -#: intervention/forms/modalForms.py:29 +#: intervention/forms/modalForms.py:27 msgid "Send this link to users who you want to have writing access on the data" msgstr "Andere Nutzer erhalten über diesen Link Zugriff auf die Daten" -#: intervention/forms/modalForms.py:39 +#: intervention/forms/modalForms.py:37 msgid "Add user to share with" msgstr "Nutzer direkt hinzufügen" -#: intervention/forms/modalForms.py:41 +#: intervention/forms/modalForms.py:39 msgid "" "Multiple selection possible - You can only select users which do not already " "have access" @@ -1295,46 +1294,46 @@ msgstr "" "Mehrfachauswahl möglich - Sie können nur Nutzer wählen, für die der Eintrag " "noch nicht freigegeben wurde" -#: intervention/forms/modalForms.py:57 +#: intervention/forms/modalForms.py:55 msgid "Remove check to remove access for this user" msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen" -#: intervention/forms/modalForms.py:69 +#: intervention/forms/modalForms.py:67 msgid "Share settings for {}" msgstr "Freigabe Einstellungen für {}" -#: intervention/forms/modalForms.py:134 +#: intervention/forms/modalForms.py:126 msgid "Date of revocation" msgstr "Datum des Widerspruchs" -#: intervention/forms/modalForms.py:145 +#: intervention/forms/modalForms.py:137 #: intervention/templates/intervention/detail/includes/revocation.html:35 msgid "Document" msgstr "Dokument" -#: intervention/forms/modalForms.py:148 konova/forms.py:364 +#: intervention/forms/modalForms.py:140 konova/forms.py:357 msgid "Must be smaller than 15 Mb" msgstr "Muss kleiner als 15 Mb sein" -#: intervention/forms/modalForms.py:172 +#: intervention/forms/modalForms.py:164 #: intervention/templates/intervention/detail/includes/revocation.html:18 msgid "Add revocation" msgstr "Widerspruch hinzufügen" -#: intervention/forms/modalForms.py:214 +#: intervention/forms/modalForms.py:181 msgid "Checked intervention data" msgstr "Eingriffsdaten geprüft" -#: intervention/forms/modalForms.py:220 +#: intervention/forms/modalForms.py:187 msgid "Checked compensations data and payments" msgstr "Kompensationen und Zahlungen geprüft" -#: intervention/forms/modalForms.py:228 +#: intervention/forms/modalForms.py:195 #: intervention/templates/intervention/detail/includes/controls.html:19 msgid "Run check" msgstr "Prüfung vornehmen" -#: intervention/forms/modalForms.py:229 konova/forms.py:449 +#: intervention/forms/modalForms.py:196 konova/forms.py:429 msgid "" "I, {} {}, confirm that all necessary control steps have been performed by " "myself." @@ -1342,23 +1341,23 @@ msgstr "" "Ich, {} {}, bestätige, dass die notwendigen Kontrollschritte durchgeführt " "wurden:" -#: intervention/forms/modalForms.py:287 +#: intervention/forms/modalForms.py:244 msgid "Only recorded accounts can be selected for deductions" msgstr "Nur verzeichnete Ökokonten können für Abbuchungen verwendet werden." -#: intervention/forms/modalForms.py:314 +#: intervention/forms/modalForms.py:271 msgid "Only shared interventions can be selected" msgstr "Nur freigegebene Eingriffe können gewählt werden" -#: intervention/forms/modalForms.py:327 +#: intervention/forms/modalForms.py:284 msgid "New Deduction" msgstr "Neue Abbuchung" -#: intervention/forms/modalForms.py:328 +#: intervention/forms/modalForms.py:285 msgid "Enter the information for a new deduction from a chosen eco-account" msgstr "Geben Sie die Informationen für eine neue Abbuchung ein." -#: intervention/forms/modalForms.py:361 +#: intervention/forms/modalForms.py:313 msgid "" "Eco-account {} is not recorded yet. You can only deduct from recorded " "accounts." @@ -1366,7 +1365,7 @@ msgstr "" "Ökokonto {} ist noch nicht verzeichnet. Abbuchungen können nur von " "verzeichneten Ökokonten erfolgen." -#: intervention/forms/modalForms.py:374 +#: intervention/forms/modalForms.py:326 msgid "" "The account {} has not enough surface for a deduction of {} m². There are " "only {} m² left" @@ -1518,69 +1517,69 @@ msgstr "" "somit nichts eingeben, bearbeiten oder sonstige Aktionen ausführen. " "Kontaktieren Sie bitte einen Administrator. +++" -#: konova/forms.py:40 templates/form/collapsable/form.html:62 +#: konova/forms.py:36 templates/form/collapsable/form.html:62 msgid "Save" msgstr "Speichern" -#: konova/forms.py:71 +#: konova/forms.py:68 msgid "Not editable" msgstr "Nicht editierbar" -#: konova/forms.py:141 konova/forms.py:312 +#: konova/forms.py:138 konova/forms.py:305 msgid "Confirm" msgstr "Bestätige" -#: konova/forms.py:153 konova/forms.py:321 +#: konova/forms.py:150 konova/forms.py:314 msgid "Remove" msgstr "Löschen" -#: konova/forms.py:155 +#: konova/forms.py:152 msgid "You are about to remove {} {}" msgstr "Sie sind dabei {} {} zu löschen" -#: konova/forms.py:246 konova/utils/quality.py:44 konova/utils/quality.py:46 +#: konova/forms.py:239 konova/utils/quality.py:44 konova/utils/quality.py:46 #: templates/form/collapsable/form.html:45 msgid "Geometry" msgstr "Geometrie" -#: konova/forms.py:322 +#: konova/forms.py:315 msgid "Are you sure?" msgstr "Sind Sie sicher?" -#: konova/forms.py:349 +#: konova/forms.py:342 msgid "Created on" msgstr "Erstellt" -#: konova/forms.py:351 +#: konova/forms.py:344 msgid "When has this file been created? Important for photos." msgstr "Wann wurde diese Datei erstellt oder das Foto aufgenommen?" -#: konova/forms.py:362 +#: konova/forms.py:355 #: venv/lib/python3.7/site-packages/django/db/models/fields/files.py:231 msgid "File" msgstr "Datei" -#: konova/forms.py:426 +#: konova/forms.py:397 msgid "Added document" msgstr "Dokument hinzugefügt" -#: konova/forms.py:440 +#: konova/forms.py:420 msgid "Confirm record" msgstr "Verzeichnen bestätigen" -#: konova/forms.py:448 +#: konova/forms.py:428 msgid "Record data" msgstr "Daten verzeichnen" -#: konova/forms.py:455 +#: konova/forms.py:435 msgid "Confirm unrecord" msgstr "Entzeichnen bestätigen" -#: konova/forms.py:456 +#: konova/forms.py:436 msgid "Unrecord data" msgstr "Daten entzeichnen" -#: konova/forms.py:457 +#: konova/forms.py:437 msgid "I, {} {}, confirm that this data must be unrecorded." msgstr "" "Ich, {} {}, bestätige, dass diese Daten wieder entzeichnet werden müssen." @@ -1609,19 +1608,19 @@ msgstr "Wenn meine freigegebenen Daten gelöscht wurden" msgid "On registered data edited" msgstr "Wenn meine freigegebenen Daten bearbeitet wurden" -#: konova/models.py:231 +#: konova/models/deadline.py:18 msgid "Finished" msgstr "Umgesetzt bis" -#: konova/models.py:232 +#: konova/models/deadline.py:19 msgid "Maintain" msgstr "Unterhaltung bis" -#: konova/models.py:233 +#: konova/models/deadline.py:20 msgid "Control" msgstr "Kontrolle am" -#: konova/models.py:234 +#: konova/models/deadline.py:21 msgid "Other" msgstr "Sonstige" @@ -1708,7 +1707,7 @@ msgstr "Hierfür müssen Sie einer anderen Nutzergruppe angehören!" #: konova/utils/message_templates.py:19 msgid "Status of Checked and Recorded reseted" -msgstr "'Geprüft' und 'Verzeichnet' sind zurückgesetzt worden" +msgstr "'Geprüft'/'Verzeichnet' wurde zurückgesetzt" #: konova/utils/message_templates.py:22 msgid "" @@ -1716,6 +1715,18 @@ msgid "" "conservation office member can perform this action." msgstr "" +#: konova/utils/message_templates.py:25 +msgid "Edited general data" +msgstr "Allgemeine Daten bearbeitet" + +#: konova/utils/message_templates.py:26 +msgid "Added compensation state" +msgstr "Zustand hinzugefügt" + +#: konova/utils/message_templates.py:28 +msgid "Added compensation action" +msgstr "Maßnahme hinzufügen" + #: konova/utils/messenger.py:69 msgid "{} checked" msgstr "{} geprüft" @@ -1935,15 +1946,15 @@ msgstr "" msgid "User contact data" msgstr "Kontaktdaten" -#: user/models.py:50 +#: user/models/user_action.py:21 msgid "Unrecorded" msgstr "Entzeichnet" -#: user/models.py:52 +#: user/models/user_action.py:23 msgid "Edited" msgstr "Bearbeitet" -#: user/models.py:53 +#: user/models/user_action.py:24 msgid "Deleted" msgstr "Gelöscht" @@ -2601,14 +2612,6 @@ msgstr "" msgid "Unknown" msgstr "" -#: venv/lib/python3.7/site-packages/django/forms/widgets.py:710 -msgid "Yes" -msgstr "" - -#: venv/lib/python3.7/site-packages/django/forms/widgets.py:711 -msgid "No" -msgstr "" - #. Translators: Please do not add spaces around commas. #: venv/lib/python3.7/site-packages/django/template/defaultfilters.py:790 msgid "yes,no,maybe" @@ -3179,6 +3182,15 @@ msgstr "" msgid "A fontawesome icon field" msgstr "" +#~ msgid "Added payment" +#~ msgstr "Zahlung hinzufügen" + +#~ msgid "Added state" +#~ msgstr "Zustand hinzugefügt" + +#~ msgid "Added action" +#~ msgstr "Maßnahme hinzugefügt" + #~ msgid "Share with user" #~ msgstr "Freigeben für Nutzer" diff --git a/user/views.py b/user/views.py index a719c5b..f63b14b 100644 --- a/user/views.py +++ b/user/views.py @@ -83,7 +83,7 @@ def contact_view(request: HttpRequest, id: str): """ user = get_object_or_404(User, id=id) - form = UserContactForm(request.POST or None, instance=user, user=request.user) + form = UserContactForm(request.POST or None, instance=user, request=request) template = "modal/modal_form.html" context = { "form": form,