Skip to content

Commit

Permalink
FIX #18356
Browse files Browse the repository at this point in the history
give signal_uid request id, so nested request does not cancel
store_rendered_templates.
  • Loading branch information
bmihelac committed May 20, 2012
1 parent 720bd81 commit 86a374e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django/test/client.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 86a374e

Please sign in to comment.