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

@ -296,6 +296,7 @@ class Rack(ChangeLoggedModel, CustomFieldModel):
return reverse('dcim:rack', args=[self.pk])
def clean(self):
super().clean()
# Validate outer dimensions and unit
if (self.outer_width is not None or self.outer_depth is not None) and not self.outer_unit:
@ -602,6 +603,7 @@ class RackReservation(ChangeLoggedModel, CustomFieldModel):
return reverse('dcim:rackreservation', args=[self.pk])
def clean(self):
super().clean()
if hasattr(self, 'rack') and self.units: