rename_stream: Move stream already has name check to view.

This commit is contained in:
Tim Abbott
2017-01-29 19:03:32 -08:00
parent d059a0a90a
commit ccdf17f47e
2 changed files with 3 additions and 2 deletions

View File

@@ -2067,7 +2067,7 @@ def do_rename_stream(realm, old_name, new_name, log=True):
if not stream:
raise JsonableError(_('Unknown stream "%s"') % (old_name,))
if get_stream(new_name, realm) and old_name.lower() != new_name.lower():
if get_stream(new_name, realm) is not None:
raise JsonableError(_('Stream name "%s" is already taken') % (new_name,))
old_name = stream.name