[0.91-bugfixes] Fixed, once again, the stale-db connection problem. Seems [3725] wasn't applied to the wsgi handler

git-svn-id: http://code.djangoproject.com/svn/django/branches/0.91-bugfixes@7155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss 2008-02-25 18:02:13 +00:00
parent 8bc36e726c
commit 2c03839d79
1 changed files with 3 additions and 4 deletions

View File

@ -178,13 +178,12 @@ class WSGIHandler(BaseHandler):
try:
request = WSGIRequest(environ)
response = self.get_response(request.path, request)
# Apply response middleware
for middleware_method in self._response_middleware:
response = middleware_method(request, response)
finally:
db.db.close()
# Apply response middleware
for middleware_method in self._response_middleware:
response = middleware_method(request, response)
try:
status_text = STATUS_CODE_TEXT[response.status_code]
except KeyError: