mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Change to @cached_property
This commit is contained in:
parent
0b8a57c2c3
commit
1bcc3d10ec
@ -1523,7 +1523,7 @@ class MACAddress(PrimaryModel):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.mac_address)
|
return str(self.mac_address)
|
||||||
|
|
||||||
@property
|
@cached_property
|
||||||
def is_primary(self):
|
def is_primary(self):
|
||||||
if self.assigned_object and hasattr(self.assigned_object, 'primary_mac_address'):
|
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:
|
if self.assigned_object.primary_mac_address and self.assigned_object.primary_mac_address.pk == self.pk:
|
||||||
|
Loading…
Reference in New Issue
Block a user