mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Update UI to disable interface assignment when assigned as primary
This commit is contained in:
parent
b25ffc3168
commit
7a13113b36
@ -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