From b6066fc74047815260a1966c0d91a8c383810d6e Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Tue, 24 Oct 2023 01:00:43 +0200 Subject: [PATCH] Fix requirement assessment exception Requirement assessment does not have a name. --- core/base_models.py | 1 - core/models.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/base_models.py b/core/base_models.py index da85416ac..54a92867b 100644 --- a/core/base_models.py +++ b/core/base_models.py @@ -82,7 +82,6 @@ def clean(self) -> None: field_errors = {} _fields_to_check = self.fields_to_check if hasattr(self, 'fields_to_check') else ['name'] if not self.is_unique_in_scope(scope=scope, fields_to_check=_fields_to_check): - print(_fields_to_check, self) for field in _fields_to_check: field_errors[field] = ValidationError( _("Value already used in this scope."), diff --git a/core/models.py b/core/models.py index ecfe289b3..e3bcd9f3f 100644 --- a/core/models.py +++ b/core/models.py @@ -459,6 +459,8 @@ class Status(models.TextChoices): related_name="requirement_assessments", ) + fields_to_check = [] + def __str__(self) -> str: if self.requirement.name not in ("", "-"): return f"{self.assessment} - {self.requirement.get_requirement_group()}. {self.requirement.get_requirement_group().description}/{self.requirement}"