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.

users: clarify confusing check for last owner.

Tim Abbott86137dc02fa5
diff --git a/zerver/views/users.py b/zerver/views/users.py
index 5612f37c805..62c2c2871bc 100644
--- a/zerver/views/users.py
+++ b/zerver/views/users.py
@@ -198,7 +198,7 @@ def update_user_backend(
if UserProfile.ROLE_REALM_OWNER in [role, target.role] and not user_profile.is_realm_owner:
raise OrganizationOwnerRequired()
- if target.role == UserProfile.ROLE_REALM_OWNER and check_last_owner(user_profile):
+ if target.role == UserProfile.ROLE_REALM_OWNER and check_last_owner(target):
raise JsonableError(
_("The owner permission cannot be removed from the only organization owner.")
)