summaryrefslogtreecommitdiff
path: root/django/middleware/cache.py
diff options
context:
space:
mode:
authorChristopher Long <indirecthit@gmail.com>2006-08-20 22:49:48 +0000
committerChristopher Long <indirecthit@gmail.com>2006-08-20 22:49:48 +0000
commit49c1c2fdd3a4b997aa009faf85a9ae6665fa4e00 (patch)
tree481132d05d747ddbb998bdce57fc516fbc88438d /django/middleware/cache.py
parent455842e07e44c63f45850e7471b1f19826af6235 (diff)
[per-object-permissions] Update to trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3630 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware/cache.py')
-rw-r--r--django/middleware/cache.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/middleware/cache.py b/django/middleware/cache.py
index 08e77d1375..58800b24da 100644
--- a/django/middleware/cache.py
+++ b/django/middleware/cache.py
@@ -41,6 +41,9 @@ class CacheMiddleware(object):
def process_request(self, request):
"Checks whether the page is already cached and returns the cached version if available."
+ if self.cache_anonymous_only:
+ assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."
+
if not request.method in ('GET', 'HEAD') or request.GET:
request._cache_update_cache = False
return None # Don't bother checking the cache.