summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorDongqing Hu <sorra@outlook.com>2017-03-29 11:45:15 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-03-29 11:45:15 +0000
commit6dd76954443180e8fe97950e230ea6d1e2400d65 (patch)
treea3ada4ea616e2aaabed3a25a9960f19bd59b99e3 /app/controllers/groups
parentb0e18eaf87e446caa075ba56c0e805b514206e10 (diff)
downloadgitlab-ce-6dd76954443180e8fe97950e230ea6d1e2400d65.tar.gz
Labels support color names in backend
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/labels_controller.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb
index 587898a8634..facb25525b5 100644
--- a/app/controllers/groups/labels_controller.rb
+++ b/app/controllers/groups/labels_controller.rb
@@ -26,7 +26,7 @@ class Groups::LabelsController < Groups::ApplicationController
end
def create
- @label = @group.labels.create(label_params)
+ @label = Labels::CreateService.new(label_params).execute(group: group)
if @label.valid?
redirect_to group_labels_path(@group)
@@ -40,7 +40,9 @@ class Groups::LabelsController < Groups::ApplicationController
end
def update
- if @label.update_attributes(label_params)
+ @label = Labels::UpdateService.new(label_params).execute(@label)
+
+ if @label.valid?
redirect_back_or_group_labels_path
else
render :edit