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.

rest: Fix a type: ignore issue.

Anders Kaseorgc242d176baa4
diff --git a/zerver/lib/rest.py b/zerver/lib/rest.py
index 1430ac21dfe..01095d21bfe 100644
--- a/zerver/lib/rest.py
+++ b/zerver/lib/rest.py
@@ -138,10 +138,9 @@ def rest_dispatch(request: HttpRequest, **kwargs: Any) -> HttpResponse:
elif request.META.get('HTTP_AUTHORIZATION', None):
# Wrap function with decorator to authenticate the user before
# proceeding
- view_kwargs = {}
- if 'allow_incoming_webhooks' in view_flags:
- view_kwargs['is_webhook'] = True
- target_function = authenticated_rest_api_view(**view_kwargs)(target_function) # type: ignore[arg-type] # likely mypy bug
+ target_function = authenticated_rest_api_view(
+ is_webhook='allow_incoming_webhooks' in view_flags,
+ )(target_function)
# Pick a way to tell user they're not authed based on how the request was made
else:
# If this looks like a request from a top-level page in a