mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
middleware: Use request.user for logging when possible.
Instead of trying to set the _requestor_for_logs attribute in all the relevant places, we try to use request.user when possible (that will be when it's a UserProfile or RemoteZulipServer as of now). In other places, we set _requestor_for_logs to avoid manually editing the request.user attribute, as it should mostly be left for Django to manage it. In places where we remove the "request._requestor_for_logs = ..." line, it is clearly implied by the previous code (or the current surrounding code) that request.user is of the correct type.
This commit is contained in:
committed by
Tim Abbott
parent
0255ca9b6a
commit
89394fc1eb
@@ -280,7 +280,6 @@ class HostRequestMock:
|
||||
self.method = ''
|
||||
self.body = ''
|
||||
self.content_type = ''
|
||||
self._requestor_for_logs = ''
|
||||
|
||||
def get_host(self) -> str:
|
||||
return self.host
|
||||
|
||||
Reference in New Issue
Block a user