Projet

Général

Profil

0001-postgresql_backend-clear-_cache-on-current-ContentTy.patch

Benjamin Dauvergne, 15 avril 2019 13:17

Télécharger (1,05 ko)

Voir les différences:

Subject: [PATCH] postgresql_backend: clear _cache on current
 ContentType.objects (#32248)

 tenant_schemas/postgresql_backend/base.py | 4 ++++
 1 file changed, 4 insertions(+)
tenant_schemas/postgresql_backend/base.py
205 205
    ContentTypeManager_old__init__(self, *args, **kwargs)
206 206
    if '_cache' in self.__dict__:
207 207
        del self._cache
208

  
208 209
ContentTypeManager.__init__ = ContentTypeManager_new__init__
209 210

  
211
if '_cache' in ContentType.objects.__dict__:
212
    del ContentType.objects._cache
213

  
210 214
if hasattr(ContentType._meta, 'local_managers'):
211 215
    for manager in ContentType._meta.local_managers:
212 216
        if '_cache' in manager.__dict__:
213
-