mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes: #18433 - Fix missing is_primary property on MACAddress model
This commit is contained in:
parent
d11deb6678
commit
51a79505fe
@ -1522,3 +1522,10 @@ class MACAddress(PrimaryModel):
|
||||
|
||||
def __str__(self):
|
||||
return str(self.mac_address)
|
||||
|
||||
@property
|
||||
def is_primary(self):
|
||||
if self.assigned_object and hasattr(self.assigned_object, 'primary_mac_address'):
|
||||
if self.assigned_object.primary_mac_address and self.assigned_object.primary_mac_address.pk == self.pk:
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user