mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 12:56:24 -06:00
Remove form-level validation
This commit is contained in:
parent
5029dd4eaf
commit
640a325551
@ -923,15 +923,6 @@ class MACAddressForm(NetBoxModelForm):
|
|||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
def clean_is_primary(self):
|
|
||||||
# If setting this MACAddress to primary, unset all the rest on this interface
|
|
||||||
if is_primary := self.cleaned_data['is_primary']:
|
|
||||||
if interface := self.cleaned_data['interface']:
|
|
||||||
interface.mac_addresses.all().update(is_primary=False)
|
|
||||||
if vminterface := self.cleaned_data['vminterface']:
|
|
||||||
vminterface.mac_addresses.all().update(is_primary=False)
|
|
||||||
return is_primary
|
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user