mirror of https://github.com/zulip/zulip.git
user_status: Rename `get_user_status_dict` function.
Renames `get_user_status_dict` function to `get_all_users_status_dict` to distinguish it from new `get_user_status` function.
This commit is contained in:
parent
20d6dd110a
commit
d6672c57ff
|
@ -60,7 +60,7 @@ from zerver.lib.user_groups import (
|
|||
get_server_supported_permission_settings,
|
||||
user_groups_in_realm_serialized,
|
||||
)
|
||||
from zerver.lib.user_status import get_user_status_dict
|
||||
from zerver.lib.user_status import get_all_users_status_dict
|
||||
from zerver.lib.user_topics import get_topic_mutes, get_user_topics
|
||||
from zerver.lib.users import (
|
||||
get_cross_realm_dicts,
|
||||
|
@ -681,7 +681,7 @@ def fetch_initial_state_data(
|
|||
state["user_status"] = (
|
||||
{}
|
||||
if user_profile is None
|
||||
else get_user_status_dict(realm=realm, user_profile=user_profile)
|
||||
else get_all_users_status_dict(realm=realm, user_profile=user_profile)
|
||||
)
|
||||
|
||||
if want("user_topic"):
|
||||
|
|
|
@ -49,7 +49,7 @@ def format_user_status(row: RawUserInfoDict) -> UserInfoDict:
|
|||
return dct
|
||||
|
||||
|
||||
def get_user_status_dict(realm: Realm, user_profile: UserProfile) -> Dict[str, UserInfoDict]:
|
||||
def get_all_users_status_dict(realm: Realm, user_profile: UserProfile) -> Dict[str, UserInfoDict]:
|
||||
query = UserStatus.objects.filter(
|
||||
user_profile__realm_id=realm.id,
|
||||
user_profile__is_active=True,
|
||||
|
|
|
@ -3,7 +3,7 @@ from typing import Any, Dict, Optional
|
|||
import orjson
|
||||
|
||||
from zerver.lib.test_classes import ZulipTestCase
|
||||
from zerver.lib.user_status import UserInfoDict, get_user_status_dict, update_user_status
|
||||
from zerver.lib.user_status import UserInfoDict, get_all_users_status_dict, update_user_status
|
||||
from zerver.models import UserProfile, UserStatus
|
||||
from zerver.models.clients import get_client
|
||||
|
||||
|
@ -11,7 +11,7 @@ from zerver.models.clients import get_client
|
|||
def user_status_info(user: UserProfile, acting_user: Optional[UserProfile] = None) -> UserInfoDict:
|
||||
if acting_user is None:
|
||||
acting_user = user
|
||||
user_dict = get_user_status_dict(user.realm, acting_user)
|
||||
user_dict = get_all_users_status_dict(user.realm, acting_user)
|
||||
return user_dict.get(str(user.id), {})
|
||||
|
||||
|
||||
|
@ -286,7 +286,7 @@ class UserStatusTest(ZulipTestCase):
|
|||
expected_event=dict(type="user_status", user_id=hamlet.id, status_text=""),
|
||||
)
|
||||
self.assertEqual(
|
||||
get_user_status_dict(realm=realm, user_profile=hamlet),
|
||||
get_all_users_status_dict(realm=realm, user_profile=hamlet),
|
||||
{},
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue