Changed SessionMiddleware to use process_request instead of process_view -- that way it always gets called, even for 404s

git-svn-id: http://code.djangoproject.com/svn/django/trunk@545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-08-22 19:19:54 +00:00
parent 601a892ea0
commit 928832d6e0
2 changed files with 1 additions and 4 deletions

View File

@ -22,9 +22,6 @@ class CommonMiddleware:
- Flat files: for 404 responses, a flat file matching the given path - Flat files: for 404 responses, a flat file matching the given path
will be looked up and used if found. will be looked up and used if found.
You probably want the CommonMiddleware object to the first entry in your
MIDDLEWARE_CLASSES setting;
""" """
def process_request(self, request): def process_request(self, request):

View File

@ -52,7 +52,7 @@ class SessionWrapper(object):
_session = property(_get_session) _session = property(_get_session)
class SessionMiddleware: class SessionMiddleware:
def process_view(self, request, view_func, param_dict): def process_request(self, request):
request.session = SessionWrapper(request.COOKIES.get(SESSION_COOKIE_NAME, None)) request.session = SessionWrapper(request.COOKIES.get(SESSION_COOKIE_NAME, None))
def process_response(self, request, response): def process_response(self, request, response):