mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 04:12:02 +00:00
mypy: Move assertion into similar branch in get_recipient_info.
This commit is contained in:
committed by
Greg Price
parent
2ed1ab4b7a
commit
79582a59f1
@@ -840,12 +840,6 @@ def get_recipient_info(recipient: Recipient,
|
|||||||
sender_id: int,
|
sender_id: int,
|
||||||
stream_topic: Optional[StreamTopicTarget],
|
stream_topic: Optional[StreamTopicTarget],
|
||||||
possibly_mentioned_user_ids: Optional[Set[int]]=None) -> RecipientInfoResult:
|
possibly_mentioned_user_ids: Optional[Set[int]]=None) -> RecipientInfoResult:
|
||||||
if recipient.type == Recipient.STREAM:
|
|
||||||
# Anybody calling us w/r/t a stream message needs to supply
|
|
||||||
# stream_topic. We may eventually want to have different versions
|
|
||||||
# of this function for different message types.
|
|
||||||
assert(stream_topic is not None)
|
|
||||||
|
|
||||||
stream_push_user_ids = set() # type: Set[int]
|
stream_push_user_ids = set() # type: Set[int]
|
||||||
|
|
||||||
if recipient.type == Recipient.PERSONAL:
|
if recipient.type == Recipient.PERSONAL:
|
||||||
@@ -855,6 +849,11 @@ def get_recipient_info(recipient: Recipient,
|
|||||||
assert(len(message_to_user_ids) in [1, 2])
|
assert(len(message_to_user_ids) in [1, 2])
|
||||||
|
|
||||||
elif recipient.type == Recipient.STREAM:
|
elif recipient.type == Recipient.STREAM:
|
||||||
|
# Anybody calling us w/r/t a stream message needs to supply
|
||||||
|
# stream_topic. We may eventually want to have different versions
|
||||||
|
# of this function for different message types.
|
||||||
|
assert(stream_topic is not None)
|
||||||
|
|
||||||
subscription_rows = stream_topic.get_active_subscriptions().values(
|
subscription_rows = stream_topic.get_active_subscriptions().values(
|
||||||
'user_profile_id',
|
'user_profile_id',
|
||||||
'push_notifications',
|
'push_notifications',
|
||||||
|
|||||||
Reference in New Issue
Block a user