Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-11-24 15:22:38 +0300
committerRémy Coutable <remy@rymai.me>2016-11-24 15:22:38 +0300
commit304163becba3610a99dfff644c13972a2f54ed3b (patch)
tree643be0d2dcddadf16d3996a28617203939cbb480 /lib/api/triggers.rb
parent4d2e7894efa36cc1b5de9432e25fcf22b6cf1d59 (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.rb2
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