mirror of https://github.com/zulip/zulip.git
mypy: Correct get*notifications_stream to return Optional[Stream].
This commit is contained in:
parent
d01dcbd018
commit
451af39561
|
@ -244,12 +244,12 @@ class Realm(models.Model):
|
||||||
# Remove the port. Mainly needed for development environment.
|
# Remove the port. Mainly needed for development environment.
|
||||||
return self.host.split(':')[0]
|
return self.host.split(':')[0]
|
||||||
|
|
||||||
def get_notifications_stream(self) -> Optional['Realm']:
|
def get_notifications_stream(self) -> Optional['Stream']:
|
||||||
if self.notifications_stream is not None and not self.notifications_stream.deactivated:
|
if self.notifications_stream is not None and not self.notifications_stream.deactivated:
|
||||||
return self.notifications_stream
|
return self.notifications_stream
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_signup_notifications_stream(self) -> Optional['Realm']:
|
def get_signup_notifications_stream(self) -> Optional['Stream']:
|
||||||
if self.signup_notifications_stream is not None and not self.signup_notifications_stream.deactivated:
|
if self.signup_notifications_stream is not None and not self.signup_notifications_stream.deactivated:
|
||||||
return self.signup_notifications_stream
|
return self.signup_notifications_stream
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue