0001-fix-custom-content-type-cache-__get__-method-10308.patch
tenant_schemas/postgresql_backend/base.py | ||
---|---|---|
174 | 174 |
# Make the ContentType cache tenant and thread safe |
175 | 175 |
ContentTypeManager._thread_local_cache = threading.local() |
176 | 176 |
class ContentTypeCacheDescriptor(object): |
177 |
def __get__(self, obj): |
|
178 |
if not hasattr(obj._thread_local_cache, '_cache'):
|
|
179 |
obj._thread_local_cache._cache = {}
|
|
180 |
return obj._thread_local_cache._cache
|
|
177 |
def __get__(self, obj, owner):
|
|
178 |
if not hasattr(owner._thread_local_cache, '_cache'):
|
|
179 |
owner._thread_local_cache._cache = {}
|
|
180 |
return owner._thread_local_cache._cache
|
|
181 | 181 |
ContentTypeManager._cache = ContentTypeCacheDescriptor() |
182 |
- |