summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-07-28 13:40:29 +0300
committerFatih Acet <acetfatih@gmail.com>2016-08-11 01:15:27 +0300
commit5dffd21cd526fadc3daa041fe88b60388dc786ed (patch)
treedbc6c9d649cf292ec1059fa2e883f00fd9d7dab4 /app
parent279c61f3cbe79f37578ff4366adfc55a63cc5b5b (diff)
downloadgitlab-ce-5dffd21cd526fadc3daa041fe88b60388dc786ed.tar.gz
Fix error message for existing labels.label-flash
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/labels_select.js12
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');
}