fix custom content type cache __get__ method (#10308)
This commit is contained in:
parent
eb0a27e712
commit
b3914c84cf
|
@ -179,8 +179,8 @@ class FakeTenant:
|
|||
# Make the ContentType cache tenant and thread safe
|
||||
ContentTypeManager._thread_local_cache = threading.local()
|
||||
class ContentTypeCacheDescriptor(object):
|
||||
def __get__(self, obj):
|
||||
if not hasattr(obj._thread_local_cache, '_cache'):
|
||||
obj._thread_local_cache._cache = {}
|
||||
return obj._thread_local_cache._cache
|
||||
def __get__(self, obj, owner):
|
||||
if not hasattr(owner._thread_local_cache, '_cache'):
|
||||
owner._thread_local_cache._cache = {}
|
||||
return owner._thread_local_cache._cache
|
||||
ContentTypeManager._cache = ContentTypeCacheDescriptor()
|
||||
|
|
Loading…
Reference in New Issue