1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #5531: Ensure consistent calls to parent clean() methods for models, forms

This commit is contained in:
Jeremy Stretch
2020-12-28 12:54:42 -05:00
parent cc1a43e5d9
commit b2e05aafc1
9 changed files with 28 additions and 1 deletions

View File

@ -47,6 +47,8 @@ class CustomFieldModel(models.Model):
])
def clean(self):
super().clean()
custom_fields = {cf.name: cf for cf in CustomField.objects.get_for_model(self)}
# Validate all field values
@ -172,6 +174,8 @@ class CustomField(models.Model):
obj.save()
def clean(self):
super().clean()
# Validate the field's default value (if any)
if self.default is not None:
try: