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:
Diffstat (limited to 'app/services/ci/runners/reset_registration_token_service.rb')
-rw-r--r--app/services/ci/runners/reset_registration_token_service.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/services/ci/runners/reset_registration_token_service.rb b/app/services/ci/runners/reset_registration_token_service.rb
index 2a3fb08c5e1..81a70a771cf 100644
--- a/app/services/ci/runners/reset_registration_token_service.rb
+++ b/app/services/ci/runners/reset_registration_token_service.rb
@@ -13,11 +13,10 @@ module Ci
def execute
return unless @user.present? && @user.can?(:update_runners_registration_token, scope)
- case scope
- when ::ApplicationSetting
+ if scope.respond_to?(:runners_registration_token)
scope.reset_runners_registration_token!
- ApplicationSetting.current_without_cache.runners_registration_token
- when ::Group, ::Project
+ scope.runners_registration_token
+ else
scope.reset_runners_token!
scope.runners_token
end