0.90-bugfixes: fix a problem on mod_python that could result in stale DB connections

git-svn-id: http://code.djangoproject.com/svn/django/branches/0.90-bugfixes@3726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
James Bennett 2006-09-05 16:04:23 +00:00
parent 6eefa521be
commit b2f1f380b3
1 changed files with 3 additions and 4 deletions

View File

@ -137,13 +137,12 @@ class ModPythonHandler(BaseHandler):
try: try:
request = ModPythonRequest(req) request = ModPythonRequest(req)
response = self.get_response(req.uri, request) response = self.get_response(req.uri, request)
# Apply response middleware
for middleware_method in self._response_middleware:
response = middleware_method(request, response)
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