summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2019-08-22 19:05:43 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2019-08-22 19:39:11 +0200
commitcc18c332e0b99f7b674a56a5be59e8b118c81289 (patch)
tree7bc8ead15d93201717f036788c87e3ddfca960e5 /app/services
parent30f302d2beb78af896213850c570792ce3d88b97 (diff)
downloadgitlab-ce-cc18c332e0b99f7b674a56a5be59e8b118c81289.tar.gz
Add test, reduce complexity
Diffstat (limited to 'app/services')
-rw-r--r--app/services/application_settings/update_service.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb
index 13718734844..8115585b7a8 100644
--- a/app/services/application_settings/update_service.rb
+++ b/app/services/application_settings/update_service.rb
@@ -7,8 +7,7 @@ module ApplicationSettings
attr_reader :params, :application_setting
def execute
- disable_ext_auth = params[:external_authorization_service_enabled].present? && !Gitlab::Utils.to_boolean(params[:external_authorization_service_enabled])
- validate_classification_label(application_setting, :external_authorization_service_default_label) unless disable_ext_auth
+ validate_classification_label(application_setting, :external_authorization_service_default_label) unless bypass_external_auth?
if application_setting.errors.any?
return false
@@ -60,5 +59,9 @@ module ApplicationSettings
Group.find_by_full_path(group_full_path)&.id if group_full_path.present?
end
+
+ def bypass_external_auth?
+ params.key?(:external_authorization_service_enabled) && !Gitlab::Utils.to_boolean(params[:external_authorization_service_enabled])
+ end
end
end