rename_stream: Move stripping of whitespace to view.

This commit is contained in:
Tim Abbott 2017-01-29 18:59:25 -08:00
parent 4ad1fadab0
commit ab1e9f2b97
2 changed files with 3 additions and 2 deletions

View File

@ -2059,8 +2059,8 @@ def do_change_stream_invite_only(stream, invite_only):
def do_rename_stream(realm, old_name, new_name, log=True):
# type: (Realm, Text, Text, bool) -> Dict[str, Text]
old_name = old_name.strip()
new_name = new_name.strip()
old_name = old_name
new_name = new_name
stream = get_stream(old_name, realm)

View File

@ -95,6 +95,7 @@ def update_stream_backend(request, user_profile, stream_id,
if description is not None:
do_change_stream_description(user_profile.realm, stream.name, description)
if new_name is not None:
new_name = new_name.strip()
do_rename_stream(user_profile.realm, stream.name, new_name)
if is_private is not None:
do_change_stream_invite_only(stream, is_private)