mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 07:46:30 +01:00
Add .pk check to Tag/AttributeHandler when returning cached Tags and Attributes.
This commit is contained in:
parent
b3d432e0c6
commit
fb7e5762a6
2 changed files with 2 additions and 2 deletions
|
|
@ -251,7 +251,7 @@ class AttributeHandler(object):
|
|||
if key:
|
||||
cachekey = "%s-%s" % (key, category)
|
||||
attr = _TYPECLASS_AGGRESSIVE_CACHE and self._cache.get(cachekey, None)
|
||||
if attr:
|
||||
if attr and hasattr(attr, "pk") and attr.pk:
|
||||
return [attr] # return cached entity
|
||||
else:
|
||||
query = {"%s__id" % self._model : self._objid,
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class TagHandler(object):
|
|||
if key:
|
||||
cachekey = "%s-%s" % (key, category)
|
||||
tag = _TYPECLASS_AGGRESSIVE_CACHE and self._cache.get(cachekey, None)
|
||||
if tag:
|
||||
if tag and hasattr(tag, "pk") and tag.pk:
|
||||
return [tag] # return cached entity
|
||||
else:
|
||||
query = {"%s__id" % self._model : self._objid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue