request: Refactor ZulipRequestNotes to RequestNotes.

This utilizes the generic `BaseNotes` we added for multipurpose
patching. With this migration as an example, we can further support
more types of notes to replace the monkey-patching approach we have used
throughout the codebase for type safety.
This commit is contained in:
PIG208
2021-08-22 01:24:20 +08:00
committed by Tim Abbott
parent dba7b1e3a7
commit 53888e5a26
32 changed files with 124 additions and 124 deletions

View File

@@ -276,9 +276,9 @@ class ZulipWebhookFormatter(ZulipFormatter):
)
header_message = header_text if header_text else None
from zerver.lib.request import get_request_notes
from zerver.lib.request import RequestNotes
client = get_request_notes(request).client
client = RequestNotes.get_notes(request).client
assert client is not None
setattr(record, "user", f"{request.user.delivery_email} ({request.user.realm.string_id})")