mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
typing: Remove unnecessary conditional for recipient types.
It wasn't actually possible for `recipient_for_emails` to return a STREAM regardless, and this makes things read a little clearer.
This commit is contained in:
@@ -1561,8 +1561,7 @@ def check_typing_notification(sender: UserProfile, notification_to: Sequence[str
|
|||||||
except ValidationError as e:
|
except ValidationError as e:
|
||||||
assert isinstance(e.messages[0], str)
|
assert isinstance(e.messages[0], str)
|
||||||
raise JsonableError(e.messages[0])
|
raise JsonableError(e.messages[0])
|
||||||
if recipient.type == Recipient.STREAM:
|
assert recipient.type != Recipient.STREAM
|
||||||
raise ValueError('Forbidden recipient type')
|
|
||||||
return {'sender': sender, 'recipient': recipient, 'op': operator}
|
return {'sender': sender, 'recipient': recipient, 'op': operator}
|
||||||
|
|
||||||
def stream_welcome_message(stream: Stream) -> str:
|
def stream_welcome_message(stream: Stream) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user