diff --git a/src/server/caches.py b/src/server/caches.py index 19c560a6d4..fdbc4ab405 100644 --- a/src/server/caches.py +++ b/src/server/caches.py @@ -139,7 +139,7 @@ def get_attr_cache(obj, attrname): """ Attribute cache store """ - return _ATTR_CACHE[hashid(obj)].get(attrname) + return _ATTR_CACHE[hashid(obj)].get(attrname, None) def set_attr_cache(obj, attrname, attrobj): """ diff --git a/src/typeclasses/models.py b/src/typeclasses/models.py index 7bd684ae8c..b845926e33 100644 --- a/src/typeclasses/models.py +++ b/src/typeclasses/models.py @@ -1321,7 +1321,7 @@ class TypedObject(SharedMemoryModel): attribute_name: (str) The attribute's name. """ - if attribute_name not in get_attr_cache(self): + if not get_attr_cache(self, attribute_name): attrib_obj = _GA(self, "_attribute_class").objects.filter(db_obj=self).filter( db_key__iexact=attribute_name) if attrib_obj: