request: Move tornado_handler to ZulipRequestNotes.

This commit is contained in:
PIG208
2021-07-09 21:30:06 +08:00
committed by Tim Abbott
parent 742c17399e
commit 5167a93229
5 changed files with 12 additions and 6 deletions

View File

@@ -111,9 +111,12 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler):
signals.request_started.send(sender=self.__class__)
request = WSGIRequest(environ)
# We do the import during runtime to avoid cyclic dependency
from zerver.lib.request import get_request_notes
# Provide a way for application code to access this handler
# given the HttpRequest object.
request._tornado_handler = self
get_request_notes(request).tornado_handler = self
return request