From e12d3100dbce6353bc2dad082c08305e22e3e211 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 17 May 2017 12:11:10 -0700 Subject: [PATCH] settings: Fix whitespace leak in organization description. Previously, the way the organization description textarea was generated, there'd be a newline and ~12 spaces added each time on reloaded the page and hit "save changes". This change makes it so that the organization description only changes when the user actually changes it. --- static/js/settings_org.js | 2 +- .../templates/settings/organization-settings-admin.handlebars | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/static/js/settings_org.js b/static/js/settings_org.js index 2bb04e6493..2b68bef2b1 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -176,7 +176,7 @@ exports.set_up = function () { e.stopPropagation(); var new_name = $("#id_realm_name").val(); - var new_description = $("#id_realm_description").val(); + var new_description = $("#id_realm_description").val().trim(); var new_restricted = $("#id_realm_restricted_to_domain").prop("checked"); var new_invite = $("#id_realm_invite_required").prop("checked"); var new_invite_by_admins_only = $("#id_realm_invite_by_admins_only").prop("checked"); diff --git a/static/templates/settings/organization-settings-admin.handlebars b/static/templates/settings/organization-settings-admin.handlebars index c5b3b859d6..2ac4f03611 100644 --- a/static/templates/settings/organization-settings-admin.handlebars +++ b/static/templates/settings/organization-settings-admin.handlebars @@ -26,8 +26,7 @@
+ maxlength="1000">{{ realm_description }}