فهرست منبع

Change to `@cached_property`

Daniel Sheppard 1 سال پیش
والد
کامیت
3219609253
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      netbox/dcim/models/devices.py

+ 1 - 1
netbox/dcim/models/devices.py

@@ -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: