summaryrefslogtreecommitdiff
path: root/app/models/namespace_setting.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespace_setting.rb')
-rw-r--r--app/models/namespace_setting.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/namespace_setting.rb b/app/models/namespace_setting.rb
index 3ac585a6957..e7f6db38047 100644
--- a/app/models/namespace_setting.rb
+++ b/app/models/namespace_setting.rb
@@ -64,6 +64,8 @@ class NamespaceSetting < ApplicationRecord
end
def all_ancestors_have_runner_registration_enabled?
+ return false unless Gitlab::CurrentSettings.valid_runner_registrars.include?('group')
+
return true unless namespace.has_parent?
!self.class.where(namespace_id: namespace.ancestors, runner_registration_enabled: false).exists?