diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-07-28 13:40:29 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-08-11 01:15:27 +0300 |
commit | 5dffd21cd526fadc3daa041fe88b60388dc786ed (patch) | |
tree | dbc6c9d649cf292ec1059fa2e883f00fd9d7dab4 /app | |
parent | 279c61f3cbe79f37578ff4366adfc55a63cc5b5b (diff) | |
download | gitlab-ce-5dffd21cd526fadc3daa041fe88b60388dc786ed.tar.gz |
Fix error message for existing labels.label-flash
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/labels_select.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/labels_select.js b/app/assets/javascripts/labels_select.js index 675dd5b7cea..1bb0b67d0e8 100644 --- a/app/assets/javascripts/labels_select.js +++ b/app/assets/javascripts/labels_select.js @@ -70,13 +70,15 @@ name: newLabelField.val(), color: newColorField.val() }, function(label) { - var errors; $newLabelCreateButton.enable(); if (label.message != null) { - errors = _.map(label.message, function(value, key) { - return key + " " + value[0]; - }); - return $newLabelError.html(errors.join("<br/>")).show(); + var errorText = label.message; + if (_.isObject(label.message)) { + errorText = _.map(label.message, function(value, key) { + return key + " " + value[0]; + }).join('<br/>'); + } + return $newLabelError.html(errorText).show(); } else { return $('.dropdown-menu-back', $dropdown.parent()).trigger('click'); } |