Opened 18 years ago

Closed 18 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: no UI/UX: no


Settings must be accessed as attrs. patch below.

Index: django/middleware/
--- django/middleware/  (revision 3405)
+++ django/middleware/  (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)
             self.cache_anonymous_only = cache_anonymous_only

Change History (2)

comment:1 by Adrian Holovaty, 18 years ago

#2393 was a duplicate.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(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