mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Update UI to disable interface assignment when assigned as primary
This commit is contained in:
parent
277acd3a31
commit
22e320084a
@ -1810,6 +1810,11 @@ class MACAddressForm(NetBoxModelForm):
|
|||||||
|
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
if instance and instance.assigned_object and instance.assigned_object.primary_mac_address:
|
||||||
|
if instance.assigned_object.primary_mac_address.pk == instance.pk:
|
||||||
|
self.fields['interface'].disabled = True
|
||||||
|
self.fields['vminterface'].disabled = True
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user