From 045ab84e0b54dd2b8c03d281a8d4f9c15ae26a6e Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 1 Jul 2019 16:44:54 -0700 Subject: Fix broken specs due to cached application settings The /admin panel will now always return an uncached application setting to ensure it always has the most current info. --- app/helpers/application_settings_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index aaaa954047f..a7a4e945a99 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -69,7 +69,7 @@ module ApplicationSettingsHelper # toggle button effect. def import_sources_checkboxes(help_block_id, options = {}) Gitlab::ImportSources.options.map do |name, source| - checked = Gitlab::CurrentSettings.import_sources.include?(source) + checked = @application_setting.import_sources.include?(source) css_class = checked ? 'active' : '' checkbox_name = 'application_setting[import_sources][]' @@ -85,7 +85,7 @@ module ApplicationSettingsHelper def oauth_providers_checkboxes button_based_providers.map do |source| - disabled = Gitlab::CurrentSettings.disabled_oauth_sign_in_sources.include?(source.to_s) + disabled = @application_setting.disabled_oauth_sign_in_sources.include?(source.to_s) css_class = ['btn'] css_class << 'active' unless disabled checkbox_name = 'application_setting[enabled_oauth_sign_in_sources][]' -- cgit v1.2.3