From eb21522fa703c7ea235dbe409d1212989d218a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 16 Mar 2016 11:05:41 +0100 Subject: [PATCH] fix custom content type cache __get__ method (#10308) --- tenant_schemas/postgresql_backend/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tenant_schemas/postgresql_backend/base.py b/tenant_schemas/postgresql_backend/base.py index f12f9f2..c444c9a 100644 --- a/tenant_schemas/postgresql_backend/base.py +++ b/tenant_schemas/postgresql_backend/base.py @@ -174,8 +174,8 @@ else: # 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() -- 2.7.0