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

Check for extraneous custom field data on clean()

This commit is contained in:
Jeremy Stretch
2020-11-12 12:18:31 -05:00
parent aed25fea3a
commit 4a8a1ce45c
9 changed files with 69 additions and 6 deletions

View File

@@ -254,6 +254,7 @@ class DeviceType(ChangeLoggedModel, CustomFieldModel):
return yaml.dump(dict(data), sort_keys=False)
def clean(self):
super().clean()
# If editing an existing DeviceType to have a larger u_height, first validate that *all* instances of it have
# room to expand within their racks. This validation will impose a very high performance penalty when there are
@@ -634,7 +635,6 @@ class Device(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
super().validate_unique(exclude)
def clean(self):
super().clean()
# Validate site/rack combination
@@ -917,6 +917,7 @@ class VirtualChassis(ChangeLoggedModel, CustomFieldModel):
return reverse('dcim:virtualchassis', kwargs={'pk': self.pk})
def clean(self):
super().clean()
# Verify that the selected master device has been assigned to this VirtualChassis. (Skip when creating a new
# VirtualChassis.)