diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-29 22:57:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-29 22:57:17 +0300 |
commit | 37e3c3bb33c3d331fceb2840cf3c1d3c466dcfa9 (patch) | |
tree | 9d3739f627b491b42ede6424acd11b589beed25f /app/models/application_setting_implementation.rb | |
parent | b55baf593e63db9be3f446ea0cca0281a69dd2e2 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/models/application_setting_implementation.rb')
-rw-r--r-- | app/models/application_setting_implementation.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb index c489d11d462..73554ee8457 100644 --- a/app/models/application_setting_implementation.rb +++ b/app/models/application_setting_implementation.rb @@ -451,6 +451,13 @@ module ApplicationSettingImplementation invalid = repository_storages_weighted.keys - Gitlab.config.repositories.storages.keys errors.add(:repository_storages_weighted, "can't include: %{invalid_storages}" % { invalid_storages: invalid.join(", ") }) unless invalid.empty? + + repository_storages_weighted.each do |key, val| + next unless val.present? + + errors.add(:"repository_storages_weighted_#{key}", "value must be an integer") unless val.is_a?(Integer) + errors.add(:"repository_storages_weighted_#{key}", "value must be between 0 and 100") unless val.between?(0, 100) + end end def terms_exist |