user_groups: Move constants for system group names to a new class.

This commit moves constants for system group names to a new
"SystemGroups" class so that we can use these group names
in multiple classes in models.py without worrying about the
order of defining them.
This commit is contained in:
Sahil Batra
2023-09-21 16:36:39 +05:30
committed by Tim Abbott
parent 2c43c2a4db
commit e458b73a01
20 changed files with 128 additions and 118 deletions

View File

@@ -95,6 +95,7 @@ from zerver.models import (
Recipient,
Stream,
Subscription,
SystemGroups,
UserGroup,
UserGroupMembership,
UserMessage,
@@ -1350,7 +1351,7 @@ Output:
realm, invite_only, history_public_to_subscribers
)
administrators_user_group = UserGroup.objects.get(
name=UserGroup.ADMINISTRATORS_GROUP_NAME, realm=realm, is_system_group=True
name=SystemGroups.ADMINISTRATORS, realm=realm, is_system_group=True
)
try: