Skip to content
Snippets Groups Projects

Hide blank fields in string representation of ConstraintViolation and add edit link for each violation on constraint violation overview

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -529,7 +529,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)
Loading