message_flags: Add an assertion check for stream.recipient_id.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-07-21 16:31:23 -04:00 committed by Tim Abbott
parent 7233ad454f
commit d3f976a0a3
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ def mark_stream_as_read(
request: HttpRequest, user_profile: UserProfile, stream_id: int = REQ(json_validator=check_int)
) -> HttpResponse:
stream, sub = access_stream_by_id(user_profile, stream_id)
assert stream.recipient_id is not None
count = do_mark_stream_messages_as_read(user_profile, stream.recipient_id)
log_data_str = f"[{count} updated]"