diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-01-29 16:44:29 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-02-19 13:18:46 +0100 |
commit | 53f775ae6d6d0cd33a6a1421e736670b45e59309 (patch) | |
tree | c3d68f270ca486525f926a16300b2c258f433b3e /lib/api | |
parent | 8c37f0ff3093995566f7f24788f8362f481b56b6 (diff) | |
download | gitlab-ce-53f775ae6d6d0cd33a6a1421e736670b45e59309.tar.gz |
Fix runners filtering in API
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/runners.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb index b7294258c7d..799c10a1897 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -121,11 +121,11 @@ module API return runners unless scope.present? available_scopes = ::Ci::Runner::AVAILABLE_SCOPES - unless (available_scopes && scope).empty? - runners.send(scope) - else + if (available_scopes & [scope]).empty? render_api_error!('Scope contains invalid value', 400) end + + runners.send(scope) end def get_runner(id) |