From 45e216b8ac377d53dbaeaff576629f9ae91d7f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pasternak?= Date: Wed, 10 Aug 2022 22:28:21 +0200 Subject: [PATCH] Remove compatibility wrapper --- dbtemplates/utils/cache.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/dbtemplates/utils/cache.py b/dbtemplates/utils/cache.py index 32a0423..ef86a53 100644 --- a/dbtemplates/utils/cache.py +++ b/dbtemplates/utils/cache.py @@ -9,16 +9,9 @@ def get_cache_backend(): """ Compatibilty wrapper for getting Django's cache backend instance """ - if (django.VERSION[0] >= 3 and django.VERSION[1] >= 2) or django.VERSION[ - 0 - ] >= 4: # noqa - from django.core.cache import caches - - cache = caches.create_connection(settings.DBTEMPLATES_CACHE_BACKEND) - else: - from django.core.cache import _create_cache - - cache = _create_cache(settings.DBTEMPLATES_CACHE_BACKEND) + from django.core.cache import caches + cache = caches.create_connection(settings.DBTEMPLATES_CACHE_BACKEND) + # Some caches -- python-memcached in particular -- need to do a cleanup at # the end of a request cycle. If not implemented in a particular backend # cache.close is a no-op