refactoring: Remove unused assignment on ensure_stream.

There were two instances of `ensure_stream` being called and assigned to
a variable with the variable not being used elsewhere. pyflakes picked
up on this (where it didn't in the previous version likely due to tuple
unpacking), so the the variable assignment has been replaced with a call
to `ensure_stream`.
This commit is contained in:
Jack Weatherilt 2018-03-21 22:51:41 +00:00 committed by Tim Abbott
parent 3396cfc2ef
commit d857f26cd3
2 changed files with 2 additions and 2 deletions

View File

@ -1950,7 +1950,7 @@ def _internal_prep_message(realm: Realm,
raise RuntimeError("None is not a valid realm for internal_prep_message!")
if addressee.is_stream():
stream = ensure_stream(realm, addressee.stream_name())
ensure_stream(realm, addressee.stream_name())
try:
return check_message(sender, get_client("Internal"), addressee,

View File

@ -849,7 +849,7 @@ class DefaultStreamTest(ZulipTestCase):
user_profile = self.example_user('hamlet')
do_change_is_admin(user_profile, True)
stream_name = 'stream ADDED via api'
stream = ensure_stream(user_profile.realm, stream_name)
ensure_stream(user_profile.realm, stream_name)
result = self.client_post('/json/default_streams', dict(stream_name=stream_name))
self.assert_json_success(result)
self.assertTrue(stream_name in self.get_default_stream_names(user_profile.realm))