Change to @cached_property

This commit is contained in:
Daniel Sheppard
2025-01-23 18:30:54 -06:00
committed by Brian Tiemann
parent cf685ff17a
commit 61c7702c6b

View File

@@ -1523,7 +1523,7 @@ class MACAddress(PrimaryModel):
def __str__(self):
return str(self.mac_address)
@property
@cached_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: