diff options
author | Vinnie Okada <vincent@gitlab.com> | 2015-03-16 13:59:50 -0600 |
---|---|---|
committer | Vinnie Okada <vincent@gitlab.com> | 2015-03-16 13:59:50 -0600 |
commit | 2e672c39a09577a0a16e75a10a249c923d8ee863 (patch) | |
tree | 6a4b5bd872c547432aedae908920f3e7432282b8 /app/controllers | |
parent | 7c3c836d3b62c72d1adf5431c0fedc91d92a8907 (diff) | |
download | gitlab-ce-2e672c39a09577a0a16e75a10a249c923d8ee863.tar.gz |
Fix restricted visibility bugs
Check for nil values in the restricted_visibility_level validation
method, and set the restricted visibility request parameter to `[]` when
it's missing from the request.
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 8f7d5e8006f..9a5685877f8 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -21,7 +21,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController def application_setting_params restricted_levels = params[:application_setting][:restricted_visibility_levels] - unless restricted_levels.nil? + if restricted_levels.nil? + params[:application_setting][:restricted_visibility_levels] = [] + else restricted_levels.map! do |level| level.to_i end |