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:
Tim Abbott
2018-05-20 18:32:33 -07:00
parent ecdc7fb296
commit 9360af37d4

View File

@@ -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: