From cf9b95b95a4e870d6dc049646ef2880059d2369e Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Wed, 14 Dec 2022 00:53:21 -0500 Subject: [PATCH] user_groups: rename create_user_group to create_user_group_in_database. To avoid people calling "create_user_group" instead of "check_add_user_group", we rename it to make its purpose clearer. Signed-off-by: Zixuan James Li --- zerver/actions/user_groups.py | 4 ++-- zilencer/management/commands/populate_db.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zerver/actions/user_groups.py b/zerver/actions/user_groups.py index 0750900fbd..818ebb3bf2 100644 --- a/zerver/actions/user_groups.py +++ b/zerver/actions/user_groups.py @@ -26,7 +26,7 @@ class MemberGroupUserDict(TypedDict): @transaction.atomic -def create_user_group( +def create_user_group_in_database( name: str, members: List[UserProfile], realm: Realm, @@ -144,7 +144,7 @@ def check_add_user_group( acting_user: Optional[UserProfile], ) -> UserGroup: try: - user_group = create_user_group( + user_group = create_user_group_in_database( name, initial_members, realm, description=description, acting_user=acting_user ) do_send_create_user_group_event(user_group, initial_members) diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py index b45c5417a5..cb40aa22cd 100644 --- a/zilencer/management/commands/populate_db.py +++ b/zilencer/management/commands/populate_db.py @@ -27,7 +27,7 @@ from zerver.actions.custom_profile_fields import ( from zerver.actions.message_send import build_message_send_dict, do_send_messages from zerver.actions.realm_emoji import check_add_realm_emoji from zerver.actions.streams import bulk_add_subscriptions -from zerver.actions.user_groups import create_user_group +from zerver.actions.user_groups import create_user_group_in_database from zerver.actions.users import do_change_user_role from zerver.lib.bulk_create import bulk_create_streams from zerver.lib.generate_test_data import create_test_data, generate_topics @@ -1247,6 +1247,6 @@ def create_user_groups() -> None: get_user_by_delivery_email("cordelia@zulip.com", zulip), get_user_by_delivery_email("hamlet@zulip.com", zulip), ] - create_user_group( + create_user_group_in_database( "hamletcharacters", members, zulip, description="Characters of Hamlet", acting_user=None )