mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
typing: Add none-checks for stream.recipient_id.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
944e602788
commit
058dab5818
@@ -271,6 +271,7 @@ def most_recent_message(user_profile: UserProfile) -> Message:
|
||||
def get_subscription(stream_name: str, user_profile: UserProfile) -> Subscription:
|
||||
stream = get_stream(stream_name, user_profile.realm)
|
||||
recipient_id = stream.recipient_id
|
||||
assert recipient_id is not None
|
||||
return Subscription.objects.get(
|
||||
user_profile=user_profile, recipient_id=recipient_id, active=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user