Permalink
Browse files

FIX #18356

give signal_uid request id, so nested request does not cancel
store_rendered_templates.
  • Loading branch information...
1 parent 720bd81 commit 86a374e4d149b9a11aedc69753ce91b46669d16e @bmihelac committed May 20, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 django/test/client.py
View
@@ -368,7 +368,8 @@ def request(self, **request):
# callback function.
data = {}
on_template_render = curry(store_rendered_templates, data)
- signals.template_rendered.connect(on_template_render, dispatch_uid="template-render")
+ signal_uid = "template-render-%s" % id(request)
+ signals.template_rendered.connect(on_template_render, dispatch_uid=signal_uid)
# Capture exceptions created by the handler.
got_request_exception.connect(self.store_exc_info, dispatch_uid="request-exception")
try:
@@ -414,7 +415,7 @@ def request(self, **request):
return response
finally:
- signals.template_rendered.disconnect(dispatch_uid="template-render")
+ signals.template_rendered.disconnect(dispatch_uid=signal_uid)
got_request_exception.disconnect(dispatch_uid="request-exception")
def get(self, path, data={}, follow=False, **extra):

0 comments on commit 86a374e

Please sign in to comment.