Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

report: Correct type annotation allowing unauth access.

Zixuan James Lida326aedff97
diff --git a/zerver/views/report.py b/zerver/views/report.py
index b77d00a4d3f..bfbf6b352e8 100644
--- a/zerver/views/report.py
+++ b/zerver/views/report.py
@@ -119,7 +119,7 @@ def report_unnarrow_times(
@has_request_variables
def report_error(
request: HttpRequest,
- user_profile: UserProfile,
+ maybe_user_profile: Union[AnonymousUser, UserProfile],
message: str = REQ(),
stacktrace: str = REQ(),
ui_message: bool = REQ(json_validator=check_bool),
@@ -155,9 +155,9 @@ def report_error(
if more_info.get("draft_content"):
more_info["draft_content"] = privacy_clean_markdown(more_info["draft_content"])
- if user_profile.is_authenticated:
- email = user_profile.delivery_email
- full_name = user_profile.full_name
+ if maybe_user_profile.is_authenticated:
+ email = maybe_user_profile.delivery_email
+ full_name = maybe_user_profile.full_name
else:
full_name = "Anonymous User"