mypy: Refer to default_stream in if statement, allowing type inference.

This commit is contained in:
neiljp (Neil Pilgrim)
2017-08-06 12:22:13 -07:00
committed by Greg Price
parent 982c0481d0
commit 24cc14c10d

View File

@@ -19,7 +19,7 @@ def _default_all_public_streams(user_profile, all_public_streams):
def _default_narrow(user_profile, narrow):
# type: (UserProfile, Iterable[Sequence[Text]]) -> Iterable[Sequence[Text]]
default_stream = user_profile.default_events_register_stream # type: Optional[Stream]
if not narrow and user_profile.default_events_register_stream is not None:
if not narrow and default_stream is not None:
narrow = [['stream', default_stream.name]]
return narrow