actions: Move part into zerver.lib.users.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-04-14 14:43:58 -07:00
parent e230ea2598
commit ab04068294
4 changed files with 9 additions and 6 deletions

View File

@@ -187,6 +187,7 @@ from zerver.lib.users import (
check_bot_name_available,
check_full_name,
format_user_row,
get_active_bots_owned_by_user,
get_api_key,
user_profile_to_user_row,
)
@@ -1234,10 +1235,6 @@ def change_user_is_active(user_profile: UserProfile, value: bool) -> None:
Subscription.objects.filter(user_profile=user_profile).update(is_user_active=value)
def get_active_bots_owned_by_user(user_profile: UserProfile) -> QuerySet:
return UserProfile.objects.filter(is_bot=True, is_active=True, bot_owner=user_profile)
def do_deactivate_user(
user_profile: UserProfile, _cascade: bool = True, *, acting_user: Optional[UserProfile]
) -> None: