Fixed #1376 -- Undid [2358], which broke flatpages. Thanks, Tom Tobin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c72afb811b
commit
f86004a4d3
|
@ -86,10 +86,6 @@ class BaseHandler:
|
||||||
if response is None:
|
if response is None:
|
||||||
raise ValueError, "The view %s.%s didn't return an HttpResponse object." % (callback.__module__, callback.func_name)
|
raise ValueError, "The view %s.%s didn't return an HttpResponse object." % (callback.__module__, callback.func_name)
|
||||||
|
|
||||||
# Apply response middleware
|
|
||||||
for middleware_method in self._response_middleware:
|
|
||||||
response = middleware_method(request, response)
|
|
||||||
|
|
||||||
return response
|
return response
|
||||||
except exceptions.Http404, e:
|
except exceptions.Http404, e:
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
@ -144,6 +144,10 @@ class ModPythonHandler(BaseHandler):
|
||||||
finally:
|
finally:
|
||||||
db.db.close()
|
db.db.close()
|
||||||
|
|
||||||
|
# Apply response middleware
|
||||||
|
for middleware_method in self._response_middleware:
|
||||||
|
response = middleware_method(request, response)
|
||||||
|
|
||||||
# Convert our custom HttpResponse object back into the mod_python req.
|
# Convert our custom HttpResponse object back into the mod_python req.
|
||||||
populate_apache_request(response, req)
|
populate_apache_request(response, req)
|
||||||
return 0 # mod_python.apache.OK
|
return 0 # mod_python.apache.OK
|
||||||
|
|
|
@ -160,6 +160,10 @@ class WSGIHandler(BaseHandler):
|
||||||
finally:
|
finally:
|
||||||
db.db.close()
|
db.db.close()
|
||||||
|
|
||||||
|
# Apply response middleware
|
||||||
|
for middleware_method in self._response_middleware:
|
||||||
|
response = middleware_method(request, response)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
status_text = STATUS_CODE_TEXT[response.status_code]
|
status_text = STATUS_CODE_TEXT[response.status_code]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in New Issue