From 640a325551f68c912cf3e45f48b0fcfe5fe9251a Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Thu, 14 Nov 2024 10:34:05 -0500 Subject: [PATCH] Remove form-level validation --- netbox/dcim/forms/model_forms.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py index 23a12ff0e..007d10710 100644 --- a/netbox/dcim/forms/model_forms.py +++ b/netbox/dcim/forms/model_forms.py @@ -923,15 +923,6 @@ class MACAddressForm(NetBoxModelForm): 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): super().clean()