diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-06-14 17:17:01 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-06-14 17:25:11 +0300 |
commit | f74f42386029077d0f12ac407fc6ee39aaeeaf53 (patch) | |
tree | 29004014c599c19521d26f401202d84e34649a83 /lib/api/runners.rb | |
parent | 1b03c5807fab6d2122e5a590cebfb2e7978a6659 (diff) |
Give 409 Conflict whenever the runner was already enabled
Diffstat (limited to 'lib/api/runners.rb')
-rw-r--r-- | lib/api/runners.rb | 7 |
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 |