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:
authorLin Jen-Shin <godfat@godfat.org>2016-06-14 17:17:01 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-06-14 17:25:11 +0300
commitf74f42386029077d0f12ac407fc6ee39aaeeaf53 (patch)
tree29004014c599c19521d26f401202d84e34649a83 /lib/api/runners.rb
parent1b03c5807fab6d2122e5a590cebfb2e7978a6659 (diff)
Give 409 Conflict whenever the runner was already enabled
Diffstat (limited to 'lib/api/runners.rb')
-rw-r--r--lib/api/runners.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb
index be92355d9a6..7bea4386e03 100644
--- a/lib/api/runners.rb
+++ b/lib/api/runners.rb
@@ -96,9 +96,12 @@ module API
runner = get_runner(params[:runner_id])
authenticate_enable_runner!(runner)
- runner.assign_to(user_project)
- present runner, with: Entities::Runner
+ if runner.assign_to(user_project)
+ present runner, with: Entities::Runner
+ else
+ conflict!("Runner was already enabled for this project")
+ end
end
# Disable project's runner