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

@@ -35,6 +35,7 @@ from zerver.models import (
Message,
Realm,
Stream,
SystemGroups,
UserGroup,
UserMessage,
UserProfile,
@@ -2425,7 +2426,7 @@ class EditMessageTest(EditMessageTestCase):
support = check_add_user_group(othello.realm, "support", [othello], acting_user=None)
moderators_system_group = UserGroup.objects.get(
realm=iago.realm, name=UserGroup.MODERATORS_GROUP_NAME, is_system_group=True
realm=iago.realm, name=SystemGroups.MODERATORS, is_system_group=True
)
self.login("cordelia")