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.

actions: Include ROLE_MODERATOR in realm_user_count_by_role.

sahil839d71afc5a26e5
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 950753219e1..0cd33d61d30 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -342,6 +342,7 @@ def realm_user_count_by_role(realm: Realm) -> Dict[str, Any]:
human_counts = {
str(UserProfile.ROLE_REALM_ADMINISTRATOR): 0,
str(UserProfile.ROLE_REALM_OWNER): 0,
+ str(UserProfile.ROLE_MODERATOR): 0,
str(UserProfile.ROLE_MEMBER): 0,
str(UserProfile.ROLE_GUEST): 0,
}
diff --git a/zerver/tests/test_audit_log.py b/zerver/tests/test_audit_log.py
index f6722fc78ab..45d4a2cd823 100644
--- a/zerver/tests/test_audit_log.py
+++ b/zerver/tests/test_audit_log.py
@@ -120,6 +120,8 @@ class TestRealmAuditLog(ZulipTestCase):
do_change_user_role(user_profile, UserProfile.ROLE_MEMBER, acting_user=acting_user)
do_change_user_role(user_profile, UserProfile.ROLE_REALM_OWNER, acting_user=acting_user)
do_change_user_role(user_profile, UserProfile.ROLE_MEMBER, acting_user=acting_user)
+ do_change_user_role(user_profile, UserProfile.ROLE_MODERATOR, acting_user=acting_user)
+ do_change_user_role(user_profile, UserProfile.ROLE_MEMBER, acting_user=acting_user)
old_values_seen = set()
new_values_seen = set()
for event in RealmAuditLog.objects.filter(
@@ -143,6 +145,7 @@ class TestRealmAuditLog(ZulipTestCase):
UserProfile.ROLE_MEMBER,
UserProfile.ROLE_REALM_ADMINISTRATOR,
UserProfile.ROLE_REALM_OWNER,
+ UserProfile.ROLE_MODERATOR,
},
)
self.assertEqual(old_values_seen, new_values_seen)