diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-04 16:43:28 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-04 16:43:28 +0100 |
commit | d38dd3c4ca81cdac4a3c5be4bfce930730faf99d (patch) | |
tree | e51bdd1f273b3dbff9506bfc600ff039aad0d15d /lib/api/labels.rb | |
parent | d12e764744e3be11c7ed886fb454e09a4d1f57d6 (diff) | |
parent | 64e2d884d6c8d822ae6e7d4d26af054396b74921 (diff) | |
download | gitlab-ce-d38dd3c4ca81cdac4a3c5be4bfce930730faf99d.tar.gz |
Merge remote-tracking branch 'origin/labels-api'
See merge request !7014
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/labels.rb')
-rw-r--r-- | lib/api/labels.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/labels.rb b/lib/api/labels.rb index 326e1e7ae00..238cea00fba 100644 --- a/lib/api/labels.rb +++ b/lib/api/labels.rb @@ -25,7 +25,7 @@ module API post ':id/labels' do authorize! :admin_label, user_project - label = user_project.find_label(params[:name]) + label = available_labels.find_by(title: params[:name]) conflict!('Label already exists') if label label = user_project.labels.create(declared(params, include_parent_namespaces: false).to_h) @@ -46,7 +46,7 @@ module API delete ':id/labels' do authorize! :admin_label, user_project - label = user_project.find_label(params[:name]) + label = user_project.labels.find_by(title: params[:name]) not_found!('Label') unless label present label.destroy, with: Entities::Label, current_user: current_user @@ -65,7 +65,7 @@ module API put ':id/labels' do authorize! :admin_label, user_project - label = user_project.find_label(params[:name]) + label = user_project.labels.find_by(title: params[:name]) not_found!('Label not found') unless label update_params = declared(params, |