Code

Opened 8 years ago

Closed 8 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

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by adrian

#2393 was a duplicate.

comment:2 Changed 8 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.