mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
display_recipient: Tighten function signatures with ValuesQuerySet.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
parent
07cc859120
commit
552b58afb7
@ -1,4 +1,4 @@
|
||||
from typing import Dict, List, Optional, Set, Tuple, TypedDict
|
||||
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, TypedDict
|
||||
|
||||
from zerver.lib.cache import (
|
||||
bulk_cached_fetch,
|
||||
@ -10,6 +10,9 @@ from zerver.lib.cache import (
|
||||
from zerver.lib.types import DisplayRecipientT, UserDisplayRecipient
|
||||
from zerver.models import Recipient, Stream, UserProfile, bulk_get_huddle_user_ids
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from django.db.models.query import _QuerySet as ValuesQuerySet
|
||||
|
||||
display_recipient_fields = [
|
||||
"id",
|
||||
"email",
|
||||
@ -96,7 +99,9 @@ def bulk_fetch_display_recipients(
|
||||
}
|
||||
personal_and_huddle_recipients = recipient_tuples - stream_recipients
|
||||
|
||||
def stream_query_function(recipient_ids: List[int]) -> List[TinyStreamResult]:
|
||||
def stream_query_function(
|
||||
recipient_ids: List[int],
|
||||
) -> "ValuesQuerySet[Stream, TinyStreamResult]":
|
||||
stream_ids = [
|
||||
recipient_id_to_type_pair_dict[recipient_id][1] for recipient_id in recipient_ids
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user