We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 805acf4 commit 27598e7Copy full SHA for 27598e7
debug_toolbar/panels/cache.py
@@ -6,8 +6,7 @@
6
try:
7
from django.utils.connection import ConnectionProxy
8
except ImportError:
9
- # Django 3.1 and below doesn't have a ConnectionProxy
10
- pass
+ ConnectionProxy = None
11
12
from django.conf import settings
13
from django.core import cache
@@ -257,10 +256,9 @@ def enable_instrumentation(self):
257
256
else:
258
cache.caches = CacheHandlerPatch()
259
260
- try:
+ # Wrap the patched cache inside Django's ConnectionProxy
+ if ConnectionProxy:
261
cache.cache = ConnectionProxy(cache.caches, DEFAULT_CACHE_ALIAS)
262
- except NameError:
263
264
265
def disable_instrumentation(self):
266
cache.caches = original_caches
0 commit comments