Revert "Revert "request: Refactor to record rate limit data using ZulipRequestNotes.""

This reverts commit 49eab4efef.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-07-19 14:27:29 -07:00
committed by Tim Abbott
parent 91282ab490
commit 7c32134fb5
4 changed files with 14 additions and 13 deletions

View File

@@ -238,10 +238,10 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler):
# Add to this new HttpRequest logging data from the processing of
# the original request; we will need these for logging.
request_notes.log_data = old_request_notes.log_data
if request_notes.rate_limit is not None:
request_notes.rate_limit = old_request_notes.rate_limit
if request_notes.requestor_for_logs is not None:
request_notes.requestor_for_logs = old_request_notes.requestor_for_logs
if hasattr(request, "_rate_limit"):
request._rate_limit = old_request._rate_limit
request.user = old_request.user
request_notes.client = old_request_notes.client
request_notes.client_name = old_request_notes.client_name