mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
request: Store client information using ZulipRequestNotes.
This concludes the HttpRequest migration to eliminate arbitrary attributes (except private ones that are belong to django) attached to the request object during runtime and migrated them to a separate data structure dedicated for the purpose of adding information (so called notes) to a HttpRequest.
This commit is contained in:
@@ -52,8 +52,8 @@ def add_context(event: "Event", hint: "Hint") -> Optional["Event"]:
|
||||
request = get_current_request()
|
||||
if request:
|
||||
request_notes = get_request_notes(request)
|
||||
if hasattr(request, "client"):
|
||||
event["tags"]["client"] = request.client.name
|
||||
if request_notes.client is not None:
|
||||
event["tags"]["client"] = request_notes.client.name
|
||||
if request_notes.realm is not None:
|
||||
event["tags"].setdefault("realm", request_notes.realm.string_id)
|
||||
return event
|
||||
|
||||
Reference in New Issue
Block a user