mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Corrected caching extra (cache the values, not the queryset object)
This commit is contained in:
parent
be307b4574
commit
6fa80bd971
@ -399,7 +399,7 @@ class PowerPort(CableTermination, ComponentModel):
|
|||||||
outlets = PowerOutlet.objects.filter(power_port=self)
|
outlets = PowerOutlet.objects.filter(power_port=self)
|
||||||
|
|
||||||
# The outlets are used as extra to invalidate the cache when an outlet's leg is changed
|
# The outlets are used as extra to invalidate the cache when an outlet's leg is changed
|
||||||
@cached_as(self, extra=outlets)
|
@cached_as(self, extra=list(outlets.values_list('pk', flat=True)))
|
||||||
def _stats():
|
def _stats():
|
||||||
# Power ports drawing power from the local outlets
|
# Power ports drawing power from the local outlets
|
||||||
return PowerPort.objects.filter(
|
return PowerPort.objects.filter(
|
||||||
|
Loading…
Reference in New Issue
Block a user