diff --git a/compensation/templates/compensation/detail/compensation/includes/actions.html b/compensation/templates/compensation/detail/compensation/includes/actions.html
index 87f49141..3fa4769b 100644
--- a/compensation/templates/compensation/detail/compensation/includes/actions.html
+++ b/compensation/templates/compensation/detail/compensation/includes/actions.html
@@ -74,6 +74,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/compensation/templates/compensation/detail/compensation/includes/states-after.html b/compensation/templates/compensation/detail/compensation/includes/states-after.html
index 7faa0f1e..9c02978b 100644
--- a/compensation/templates/compensation/detail/compensation/includes/states-after.html
+++ b/compensation/templates/compensation/detail/compensation/includes/states-after.html
@@ -68,6 +68,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/compensation/templates/compensation/detail/compensation/includes/states-before.html b/compensation/templates/compensation/detail/compensation/includes/states-before.html
index 23faed43..95917389 100644
--- a/compensation/templates/compensation/detail/compensation/includes/states-before.html
+++ b/compensation/templates/compensation/detail/compensation/includes/states-before.html
@@ -68,6 +68,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/compensation/templates/compensation/detail/eco_account/includes/actions.html b/compensation/templates/compensation/detail/eco_account/includes/actions.html
index 8ae7c8fd..7a986535 100644
--- a/compensation/templates/compensation/detail/eco_account/includes/actions.html
+++ b/compensation/templates/compensation/detail/eco_account/includes/actions.html
@@ -73,6 +73,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/compensation/templates/compensation/detail/eco_account/includes/states-after.html b/compensation/templates/compensation/detail/eco_account/includes/states-after.html
index 4fce2f0f..05a05e31 100644
--- a/compensation/templates/compensation/detail/eco_account/includes/states-after.html
+++ b/compensation/templates/compensation/detail/eco_account/includes/states-after.html
@@ -68,6 +68,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/compensation/templates/compensation/detail/eco_account/includes/states-before.html b/compensation/templates/compensation/detail/eco_account/includes/states-before.html
index 1c6311cb..10b3f63b 100644
--- a/compensation/templates/compensation/detail/eco_account/includes/states-before.html
+++ b/compensation/templates/compensation/detail/eco_account/includes/states-before.html
@@ -68,6 +68,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/ema/templates/ema/detail/includes/actions.html b/ema/templates/ema/detail/includes/actions.html
index 0c352c11..91110701 100644
--- a/ema/templates/ema/detail/includes/actions.html
+++ b/ema/templates/ema/detail/includes/actions.html
@@ -71,6 +71,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/ema/templates/ema/detail/includes/states-after.html b/ema/templates/ema/detail/includes/states-after.html
index 56e87be1..78cbee0a 100644
--- a/ema/templates/ema/detail/includes/states-after.html
+++ b/ema/templates/ema/detail/includes/states-after.html
@@ -66,6 +66,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/ema/templates/ema/detail/includes/states-before.html b/ema/templates/ema/detail/includes/states-before.html
index 2fd7c359..fb29024a 100644
--- a/ema/templates/ema/detail/includes/states-before.html
+++ b/ema/templates/ema/detail/includes/states-before.html
@@ -66,6 +66,10 @@
{% endif %}
+ {% empty %}
+
+ {% trans 'Missing' %}
+
{% endfor %}
diff --git a/intervention/forms/modals/deduction.py b/intervention/forms/modals/deduction.py
index 130ef2f8..8e12a442 100644
--- a/intervention/forms/modals/deduction.py
+++ b/intervention/forms/modals/deduction.py
@@ -163,6 +163,10 @@ class NewEcoAccountDeductionModalForm(BaseModalForm):
self.cleaned_data["account"].mark_as_edited(self.user, edit_comment=DEDUCTION_ADDED)
return deduction
+ def check_for_recorded_instance(self):
+ # Ignore super() implementation
+ return
+
class EditEcoAccountDeductionModalForm(NewEcoAccountDeductionModalForm):
deduction = None
@@ -231,6 +235,16 @@ class EditEcoAccountDeductionModalForm(NewEcoAccountDeductionModalForm):
old_account.send_notification_mail_on_deduction_change(data_changes)
return deduction
+ def check_for_recorded_instance(self):
+ """
+ Extension to super class base method
+
+ Returns:
+
+ """
+ if self.deduction.intervention.is_recorded:
+ self.block_form()
+
class RemoveEcoAccountDeductionModalForm(RemoveModalForm):
""" Removing modal form for EcoAccountDeduction
@@ -249,4 +263,8 @@ class RemoveEcoAccountDeductionModalForm(RemoveModalForm):
with transaction.atomic():
self.deduction.intervention.mark_as_edited(self.user, edit_comment=DEDUCTION_REMOVED)
self.deduction.account.mark_as_edited(self.user, edit_comment=DEDUCTION_REMOVED)
- self.deduction.delete()
\ No newline at end of file
+ self.deduction.delete()
+
+ def check_for_recorded_instance(self):
+ if self.deduction.intervention.is_recorded:
+ self.block_form()
diff --git a/konova/forms/base_form.py b/konova/forms/base_form.py
index fb69999c..6b71c213 100644
--- a/konova/forms/base_form.py
+++ b/konova/forms/base_form.py
@@ -134,24 +134,21 @@ class BaseForm(forms.Form):
Returns:
"""
- from intervention.forms.modals.deduction import NewEcoAccountDeductionModalForm, EditEcoAccountDeductionModalForm, \
- RemoveEcoAccountDeductionModalForm
- from konova.forms.modals.resubmission_form import ResubmissionModalForm
is_none = self.instance is None
is_other_data_type = not isinstance(self.instance, BaseObject)
- is_deduction_form_from_account = isinstance(
- self,
- (
- NewEcoAccountDeductionModalForm,
- ResubmissionModalForm,
- EditEcoAccountDeductionModalForm,
- RemoveEcoAccountDeductionModalForm,
- )
- ) and isinstance(self.instance, EcoAccount)
- if is_none or is_other_data_type or is_deduction_form_from_account:
+ if is_none or is_other_data_type:
# Do nothing
return
if self.instance.is_recorded:
- self.template = "form/recorded_no_edit.html"
+ self.block_form()
+
+ def block_form(self):
+ """
+ Overwrites template, providing no actions
+
+ Returns:
+
+ """
+ self.template = "form/recorded_no_edit.html"
\ No newline at end of file
diff --git a/konova/forms/modals/resubmission_form.py b/konova/forms/modals/resubmission_form.py
index d1d846f6..97a52dcb 100644
--- a/konova/forms/modals/resubmission_form.py
+++ b/konova/forms/modals/resubmission_form.py
@@ -83,3 +83,6 @@ class ResubmissionModalForm(BaseModalForm):
self.instance.resubmissions.add(self.resubmission)
return self.resubmission
+ def check_for_recorded_instance(self):
+ # Ignore logic in super() implementation
+ return
diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo
index fadbaa83..2c859d23 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 27f98ffc..a4a70839 100644
--- a/locale/de/LC_MESSAGES/django.po
+++ b/locale/de/LC_MESSAGES/django.po
@@ -1217,7 +1217,7 @@ msgstr "Keine Flächenmenge für Abbuchungen eingegeben. Bitte bearbeiten."
#: intervention/templates/intervention/detail/view.html:100
#: intervention/templates/intervention/detail/view.html:104
msgid "Missing"
-msgstr "fehlt"
+msgstr "Fehlend"
#: compensation/templates/compensation/detail/eco_account/view.html:71
#: ema/templates/ema/detail/view.html:57
@@ -2210,7 +2210,7 @@ msgstr "{} wurde erfolgreich vom Nutzer {} geprüft! {}"
#: konova/utils/quality.py:32
msgid "missing"
-msgstr "fehlt"
+msgstr "fehlend"
#: konova/views/home.py:78 templates/navbars/navbar.html:16
msgid "Home"