Opened 9 years ago

Closed 9 years ago

#2392 closed defect (fixed)

[patch] One more fix to r3395(CACHE_MIDDLEWARE_ANONYMOUS_ONLY)

Reported by: Alex Dedul Owned by: jacob
Component: Core (Cache system) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Settings must be accessed as attrs. patch below.

Index: django/middleware/cache.py
===================================================================
--- django/middleware/cache.py  (revision 3405)
+++ django/middleware/cache.py  (working copy)
@@ -36,7 +36,7 @@
         if key_prefix is None:
             self.key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
         if cache_anonymous_only is None:
-            self.cache_anonymous_only = settings.get('CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)
+            self.cache_anonymous_only = getattr(settings, 'CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)
         else:
             self.cache_anonymous_only = cache_anonymous_only

Change History (2)

comment:1 Changed 9 years ago by adrian

#2393 was a duplicate.

comment:2 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [3406]) Fixed #2392 -- Fixed CACHE_MIDDLEWARE_ANONYMOUS_ONLY to use attribute access to django.conf.settings

Note: See TracTickets for help on using tickets.
Back to Top