Skip to content
Snippets Groups Projects
Commit 53e43f1b authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Hide blank fields in string representation of ConstraintViolation

This fixes #130
parent 26cc3f0f
No related branches found
No related tags found
No related merge requests found
......@@ -527,7 +527,7 @@ class ConstraintViolation(models.Model):
# Stringify all other fields
for field in self.fields:
a = getattr(self, field, None)
if a is not None:
if a is not None and str(a) != '':
output.append(f"{field}: {a}")
return ", ".join(output)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment