diff --git a/ema/templates/ema/detail/view.html b/ema/templates/ema/detail/view.html
index 9ffce728..640711b2 100644
--- a/ema/templates/ema/detail/view.html
+++ b/ema/templates/ema/detail/view.html
@@ -50,6 +50,19 @@
{% trans 'Last modified' %} |
diff --git a/intervention/admin.py b/intervention/admin.py
index cf49bc39..de11ee27 100644
--- a/intervention/admin.py
+++ b/intervention/admin.py
@@ -31,7 +31,6 @@ class LegalAdmin(admin.ModelAdmin):
list_display = [
"id",
"process_type",
- "law",
"registration_date",
"binding_date",
]
diff --git a/intervention/forms.py b/intervention/forms.py
index c84c51c6..2b1ce398 100644
--- a/intervention/forms.py
+++ b/intervention/forms.py
@@ -412,10 +412,13 @@ class RunCheckForm(BaseModalForm):
super().__init__(*args, **kwargs)
self.form_title = _("Run check")
self.form_caption = _("I, {} {}, confirm that all necessary control steps have been performed by myself.").format(self.user.first_name, self.user.last_name)
- # Disable automatic w-100 setting for this type of modal form. Looks kinda strange
- self.fields["confirm"].widget.attrs["class"] = ""
- def is_valid(self):
+ def is_valid(self) -> bool:
+ """ Perform a validity check based on quality_check() logic
+
+ Returns:
+ result (bool)
+ """
super_result = super().is_valid()
# Perform check
msgs = self.instance.quality_check()
@@ -427,6 +430,11 @@ class RunCheckForm(BaseModalForm):
return super_result and (len(msgs) == 0)
def save(self):
+ """ Saving logic
+
+ Returns:
+
+ """
with transaction.atomic():
user_action = UserActionLogEntry.objects.create(
user=self.user,
diff --git a/intervention/models.py b/intervention/models.py
index f4a7e739..3a8f7ac3 100644
--- a/intervention/models.py
+++ b/intervention/models.py
@@ -136,6 +136,7 @@ class RevocationDocument(AbstractDocument):
# Folder seems to be missing already
pass
+
class LegalData(UuidModel):
"""
Holds intervention legal data such as important dates, laws or responsible handler
@@ -158,11 +159,9 @@ class LegalData(UuidModel):
"is_archived": False,
}
)
- law = models.ForeignKey(
+ laws = models.ManyToManyField(
KonovaCode,
- on_delete=models.SET_NULL,
null=True,
- related_name="+",
blank=True,
limit_choices_to={
"code_lists__in": [CODELIST_LAW_ID],
@@ -173,13 +172,6 @@ class LegalData(UuidModel):
revocation = models.OneToOneField(Revocation, null=True, blank=True, help_text="Refers to 'Widerspruch am'", on_delete=models.SET_NULL)
- def __str__(self):
- return "{} | {} | {}".format(
- self.process_type,
- self.law,
- self.id
- )
-
class Intervention(BaseObject):
"""
diff --git a/intervention/templates/intervention/detail/view.html b/intervention/templates/intervention/detail/view.html
index ee0acc4e..a279013a 100644
--- a/intervention/templates/intervention/detail/view.html
+++ b/intervention/templates/intervention/detail/view.html
@@ -34,9 +34,14 @@
| {% trans 'Process type' %} |
{{intervention.legal.process_type|default_if_none:""}} |
-