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

@@ -64,6 +64,7 @@ class PowerPanel(ChangeLoggedModel, CustomFieldModel):
)
def clean(self):
super().clean()
# RackGroup must belong to assigned Site
if self.rack_group and self.rack_group.site != self.site:
@@ -172,6 +173,7 @@ class PowerFeed(ChangeLoggedModel, PathEndpoint, CableTermination, CustomFieldMo
)
def clean(self):
super().clean()
# Rack must belong to same Site as PowerPanel
if self.rack and self.rack.site != self.power_panel.site: