mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Fix VLAN.clean()
This commit is contained in:
parent
f4e49495e2
commit
d3fee54644
@ -173,10 +173,11 @@ class VLAN(PrimaryModel):
|
|||||||
def clean(self):
|
def clean(self):
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
# Validate VLAN group
|
# Validate VLAN group (if assigned)
|
||||||
if self.group and self.group.site != self.site:
|
if self.group and self.site and self.group.scope != self.site:
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'group': "VLAN group must belong to the assigned site ({}).".format(self.site)
|
'group': f"VLAN is assigned to group {self.group} (scope: {self.group.scope}); cannot also assign to "
|
||||||
|
f"site {self.site}."
|
||||||
})
|
})
|
||||||
|
|
||||||
def to_csv(self):
|
def to_csv(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user