mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
Removed automatic cache invalidation
This commit is contained in:
parent
741645c9f7
commit
d103e13732
@ -110,20 +110,12 @@ class GenericArrayForeignKey(FieldCacheMixin, Field):
|
|||||||
def __get__(self, instance, cls=None):
|
def __get__(self, instance, cls=None):
|
||||||
if instance is None:
|
if instance is None:
|
||||||
return self
|
return self
|
||||||
rel_objects = self.get_cached_value(instance, default=None)
|
rel_objects = self.get_cached_value(instance, default=...)
|
||||||
expected_ids = self._get_ids(instance)
|
expected_ids = self._get_ids(instance)
|
||||||
# check cache actual
|
# we do not check if cache actual
|
||||||
if rel_objects is not None:
|
if rel_objects is not ...:
|
||||||
actual = [
|
return rel_objects
|
||||||
[
|
# load value
|
||||||
(self.get_content_type_of_obj(obj=item).id, item.pk)
|
|
||||||
for item in step
|
|
||||||
]
|
|
||||||
for step in rel_objects
|
|
||||||
]
|
|
||||||
if expected_ids == actual:
|
|
||||||
return rel_objects
|
|
||||||
# reload value
|
|
||||||
if expected_ids is None:
|
if expected_ids is None:
|
||||||
self.set_cached_value(instance, rel_objects)
|
self.set_cached_value(instance, rel_objects)
|
||||||
return rel_objects
|
return rel_objects
|
||||||
|
Loading…
Reference in New Issue
Block a user