don't double-apply the renderer logic

since that leads to double-finishing requests too
This commit is contained in:
Jean-Paul Calderone 2020-10-16 09:30:22 -04:00
parent 0faa24d344
commit 31207e4b6b
2 changed files with 8 additions and 1 deletions

View File

@ -526,6 +526,10 @@ def render_exception(render):
method=request.method,
handler=fullyQualifiedName(bound_render),
)
if getattr(request, "dont_apply_extra_processing", False):
with action:
return bound_render(request)
with action.context():
result = DeferredContext(maybeDeferred(bound_render, request))
result.addBoth(_finish, bound_render, request)

View File

@ -400,7 +400,10 @@ class DirectoryNodeHandler(ReplaceMeMixin, Resource, object):
# delegate to it. We could return the resource back out of
# DirectoryNodeHandler.renderHTTP, and nevow would recurse into it,
# but the addCallback() that handles when_done= would break.
d.addCallback(lambda child: child.render(req))
def render_child(child):
req.dont_apply_extra_processing = True
return child.render(req)
d.addCallback(render_child)
return d
def _POST_uri(self, req):