summaryrefslogtreecommitdiff
path: root/django/middleware/cache.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-06-20 04:34:13 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-06-20 04:34:13 +0000
commit37addba352b3443c30e6d6d862afe73e158839ca (patch)
tree1877b49fb5d66fd2ca4a4e3b0aa4d6f9d2e06c67 /django/middleware/cache.py
parentb93de6a2cb064de3ae74e7dc01a5ec5d7ff900f6 (diff)
Converted request.META['REQUEST_METHOD'] calls to request.method, throughout the Django codebase
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/middleware/cache.py')
-rw-r--r--django/middleware/cache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/middleware/cache.py b/django/middleware/cache.py
index 5510eba714..80c8626db8 100644
--- a/django/middleware/cache.py
+++ b/django/middleware/cache.py
@@ -33,7 +33,7 @@ class CacheMiddleware(object):
def process_request(self, request):
"Checks whether the page is already cached and returns the cached version if available."
- if not request.META['REQUEST_METHOD'] in ('GET', 'HEAD') or request.GET:
+ if not request.method in ('GET', 'HEAD') or request.GET:
request._cache_update_cache = False
return None # Don't bother checking the cache.
@@ -55,7 +55,7 @@ class CacheMiddleware(object):
if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
# We don't need to update the cache, just return.
return response
- if not request.META['REQUEST_METHOD'] == 'GET':
+ if request.method != 'GET':
# This is a stronger requirement than above. It is needed
# because of interactions between this middleware and the
# HTTPMiddleware, which throws the body of a HEAD-request