Code

Ticket #2393: cache.diff

File cache.diff, 788 bytes (added by ludo@…, 8 years ago)

patch to django/middleware/cache.py

Line 
1Index: django/middleware/cache.py
2===================================================================
3--- /usr/lib/python2.4/site-packages/django/middleware/cache.py (revision 3405)
4+++ /usr/lib/python2.4/site-packages/django/middleware/cache.py (working copy)
5@@ -36,7 +36,10 @@
6         if key_prefix is None:
7             self.key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
8         if cache_anonymous_only is None:
9-            self.cache_anonymous_only = settings.get('CACHE_MIDDLEWARE_ANONYMOUS_ONLY', False)
10+            try:
11+                self.cache_anonymous_only = settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY
12+            except AttributeError:
13+                self.cache_anonymous_only = False
14         else:
15             self.cache_anonymous_only = cache_anonymous_only
16