mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
decorator: Check for deactivated realm before deactivated user.
Structurally, this is the right order-of-access for data.
This commit is contained in:
parent
aaedec1fdb
commit
a124db5f7b
@ -231,11 +231,10 @@ def validate_api_key(request: HttpRequest, role: Optional[str],
|
||||
return user_profile
|
||||
|
||||
def validate_account_and_subdomain(request: HttpRequest, user_profile: UserProfile) -> None:
|
||||
if not user_profile.is_active:
|
||||
raise JsonableError(_("Account not active"))
|
||||
|
||||
if user_profile.realm.deactivated:
|
||||
raise JsonableError(_("This organization has been deactivated"))
|
||||
if not user_profile.is_active:
|
||||
raise JsonableError(_("Account not active"))
|
||||
|
||||
# Either the subdomain matches, or processing a websockets message
|
||||
# in the message_sender worker (which will have already had the
|
||||
|
||||
Loading…
Reference in New Issue
Block a user