diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2014-08-14 10:17:52 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2014-08-14 10:17:52 +0200 |
commit | cbc90565b55d89704d64bc48db323b82b739a873 (patch) | |
tree | f6bb4220068bafab7a1b1a57d2b13631a553c4a2 /app/models/concerns | |
parent | 04ad197bcc41a26da2c2a80c5b4ffbfad2c296ee (diff) | |
download | gitlab-ce-cbc90565b55d89704d64bc48db323b82b739a873.tar.gz |
Do label validation for issues/merge requests API
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/issuable.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 517e4548624..0a5fe24b5af 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -140,7 +140,8 @@ module Issuable def add_labels_by_names(label_names) label_names.each do |label_name| - label = project.labels.find_or_create_by(title: label_name.strip) + label = project.labels.create_with( + color: Label::DEFAULT_COLOR).find_or_create_by(title: label_name.strip) self.labels << label end end |