Skip to content

Commit

Permalink
Fix requirement assessment exception
Browse files Browse the repository at this point in the history
Requirement assessment does not have a name.
  • Loading branch information
eric-intuitem committed Oct 23, 2023
1 parent a416394 commit b6066fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion core/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand Down
2 changes: 2 additions & 0 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit b6066fc

Please sign in to comment.