mirror of https://github.com/zulip/zulip.git
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:
parent
e331c356e4
commit
cf9b95b95a
|
@ -26,7 +26,7 @@ class MemberGroupUserDict(TypedDict):
|
||||||
|
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def create_user_group(
|
def create_user_group_in_database(
|
||||||
name: str,
|
name: str,
|
||||||
members: List[UserProfile],
|
members: List[UserProfile],
|
||||||
realm: Realm,
|
realm: Realm,
|
||||||
|
@ -144,7 +144,7 @@ def check_add_user_group(
|
||||||
acting_user: Optional[UserProfile],
|
acting_user: Optional[UserProfile],
|
||||||
) -> UserGroup:
|
) -> UserGroup:
|
||||||
try:
|
try:
|
||||||
user_group = create_user_group(
|
user_group = create_user_group_in_database(
|
||||||
name, initial_members, realm, description=description, acting_user=acting_user
|
name, initial_members, realm, description=description, acting_user=acting_user
|
||||||
)
|
)
|
||||||
do_send_create_user_group_event(user_group, initial_members)
|
do_send_create_user_group_event(user_group, initial_members)
|
||||||
|
|
|
@ -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.message_send import build_message_send_dict, do_send_messages
|
||||||
from zerver.actions.realm_emoji import check_add_realm_emoji
|
from zerver.actions.realm_emoji import check_add_realm_emoji
|
||||||
from zerver.actions.streams import bulk_add_subscriptions
|
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.actions.users import do_change_user_role
|
||||||
from zerver.lib.bulk_create import bulk_create_streams
|
from zerver.lib.bulk_create import bulk_create_streams
|
||||||
from zerver.lib.generate_test_data import create_test_data, generate_topics
|
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("cordelia@zulip.com", zulip),
|
||||||
get_user_by_delivery_email("hamlet@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
|
"hamletcharacters", members, zulip, description="Characters of Hamlet", acting_user=None
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue