From 324b5052c6e303bb25d0cc9c32ac6eb694e4cc72 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 24 Feb 2020 23:43:52 -0800 Subject: [PATCH] stream_edit: Fix error handling for unchanged stream name. We were incorrectly passing a string version of an integer ID, e.g. "10", to a function expecting an integer, e.g. 10. Fix this by using the common get_stream_id function intended for the purpose rather than hand-written parsing. This was likely broken in the recent Dict -> IntDict/Map migrations. --- static/js/stream_edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/stream_edit.js b/static/js/stream_edit.js index 8ed07d1b5d..88a4047a20 100644 --- a/static/js/stream_edit.js +++ b/static/js/stream_edit.js @@ -400,7 +400,7 @@ function change_stream_privacy(e) { exports.change_stream_name = function (e) { e.preventDefault(); const sub_settings = $(e.target).closest('.subscription_settings'); - const stream_id = $(e.target).closest(".subscription_settings").attr("data-stream-id"); + const stream_id = get_stream_id(e.target); const new_name_box = sub_settings.find('.stream-name-editable'); const new_name = $.trim(new_name_box.text()); $(".stream_change_property_info").hide();