diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-24 15:22:38 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-24 15:22:38 +0300 |
commit | 304163becba3610a99dfff644c13972a2f54ed3b (patch) | |
tree | 643be0d2dcddadf16d3996a28617203939cbb480 /lib/api/triggers.rb | |
parent | 4d2e7894efa36cc1b5de9432e25fcf22b6cf1d59 (diff) |
API: Use `#find_project` in API::Triggers and API::Services
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/triggers.rb')
-rw-r--r-- | lib/api/triggers.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb index 569598fbd2c..bb4de39def1 100644 --- a/lib/api/triggers.rb +++ b/lib/api/triggers.rb @@ -13,7 +13,7 @@ module API optional :variables, type: Hash, desc: 'The list of variables to be injected into build' end post ":id/(ref/:ref/)trigger/builds" do - project = Project.find_with_namespace(params[:id]) || Project.find_by(id: params[:id]) + project = find_project(params[:id]) trigger = Ci::Trigger.find_by_token(params[:token].to_s) not_found! unless project && trigger unauthorized! unless trigger.project == project |