diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-06-22 10:47:48 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-06-22 10:47:48 -0300 |
commit | 2674b548601b279ada46d4b218a9def6fd5b9f6d (patch) | |
tree | ca1f09225e4d5b80c800af521735bf34f04e16d0 /app/controllers/projects/runner_projects_controller.rb | |
parent | 8447c6b180297840d835a609d95808834f498d87 (diff) | |
parent | 6f6c6f68ea7cb976b6c1598e705ba8b2bdaf05a1 (diff) | |
download | gitlab-ce-2674b548601b279ada46d4b218a9def6fd5b9f6d.tar.gz |
merge master into issue_3359_3
Diffstat (limited to 'app/controllers/projects/runner_projects_controller.rb')
-rw-r--r-- | app/controllers/projects/runner_projects_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/runner_projects_controller.rb b/app/controllers/projects/runner_projects_controller.rb index bedeb4a295c..dc1a18f8d42 100644 --- a/app/controllers/projects/runner_projects_controller.rb +++ b/app/controllers/projects/runner_projects_controller.rb @@ -6,11 +6,13 @@ class Projects::RunnerProjectsController < Projects::ApplicationController def create @runner = Ci::Runner.find(params[:runner_project][:runner_id]) + return head(403) if @runner.is_shared? || @runner.locked? return head(403) unless current_user.ci_authorized_runners.include?(@runner) path = runners_path(project) + runner_project = @runner.assign_to(project, current_user) - if @runner.assign_to(project, current_user) + if runner_project.persisted? redirect_to path else redirect_to path, alert: 'Failed adding runner to project' |