From db2e70a74ba8ca17b520cde2025e5356fadca33c Mon Sep 17 00:00:00 2001 From: James Bennett Date: Tue, 5 Sep 2006 16:03:02 +0000 Subject: [PATCH] 0.91-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.91-bugfixes@3725 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/modpython.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py index 37499c6f06..cb65170c1a 100644 --- a/django/core/handlers/modpython.py +++ b/django/core/handlers/modpython.py @@ -141,13 +141,12 @@ class ModPythonHandler(BaseHandler): try: request = ModPythonRequest(req) response = self.get_response(req.uri, 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) - # Convert our custom HttpResponse object back into the mod_python req. populate_apache_request(response, req) return 0 # mod_python.apache.OK