Use the new optional argument to endRequest in the middleware
Currently endRequest is called twice on an exception if Django
intercepts the exception and returns it's own result. By setting
optional=True we do not crash on 'assert self.in_request'.
--- a/app/soc/middleware/value_store.py Sat Sep 12 21:26:27 2009 +0200
+++ b/app/soc/middleware/value_store.py Sat Sep 12 21:27:17 2009 +0200
@@ -39,7 +39,7 @@
core = callback.getCore()
core.startNewRequest(request)
- def end(self, request):
+ def end(self, request, optional):
"""Empties the value store.
Args:
@@ -47,7 +47,7 @@
"""
core = callback.getCore()
- core.endRequest(request)
+ core.endRequest(request, optional)
def process_request(self, request):
"""Called when a request is made.
@@ -64,7 +64,7 @@
the method signature.
"""
- self.end(request)
+ self.end(request, True)
return response
def process_exception(self, request, exception):
@@ -74,4 +74,4 @@
the method signature.
"""
- self.end(request)
+ self.end(request, False)