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.

decorator: Reorder authenticated_json_view.

Tim Abbott9bf383dcae90
diff --git a/zerver/decorator.py b/zerver/decorator.py
index 1c74dbbdeb1..f0b87065053 100644
--- a/zerver/decorator.py
+++ b/zerver/decorator.py
@@ -883,13 +883,13 @@ def authenticated_json_view(
*args: ParamT.args,
**kwargs: ParamT.kwargs,
) -> HttpResponse:
- if not skip_rate_limiting:
- rate_limit(request)
-
if not request.user.is_authenticated:
raise UnauthorizedError()
user_profile = request.user
+ if not skip_rate_limiting:
+ rate_limit(request)
+
validate_account_and_subdomain(request, user_profile)
if user_profile.is_incoming_webhook: