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 <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-12-14 00:53:21 -05:00 committed by Tim Abbott
parent e331c356e4
commit cf9b95b95a
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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
)