mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Removed validation constraint prohibitting a VLAN from being both tagged and untagged
This commit is contained in:
parent
a75d7079df
commit
b22744b031
@ -1692,13 +1692,8 @@ class InterfaceForm(BootstrapMixin, forms.ModelForm):
|
|||||||
super(InterfaceForm, self).clean()
|
super(InterfaceForm, self).clean()
|
||||||
|
|
||||||
# Validate VLAN assignments
|
# Validate VLAN assignments
|
||||||
untagged_vlan = self.cleaned_data['untagged_vlan']
|
|
||||||
tagged_vlans = self.cleaned_data['tagged_vlans']
|
tagged_vlans = self.cleaned_data['tagged_vlans']
|
||||||
|
|
||||||
# A VLAN cannot be both tagged and untagged
|
|
||||||
if untagged_vlan and untagged_vlan in tagged_vlans:
|
|
||||||
raise forms.ValidationError("VLAN {} cannot be both tagged and untagged.".format(untagged_vlan))
|
|
||||||
|
|
||||||
# Untagged interfaces cannot be assigned tagged VLANs
|
# Untagged interfaces cannot be assigned tagged VLANs
|
||||||
if self.cleaned_data['mode'] == IFACE_MODE_ACCESS and tagged_vlans:
|
if self.cleaned_data['mode'] == IFACE_MODE_ACCESS and tagged_vlans:
|
||||||
raise forms.ValidationError({
|
raise forms.ValidationError({
|
||||||
|
Loading…
Reference in New Issue
Block a user