mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
DEV: Add file_size_restriction site setting type (#24704)
This change will allow admins to configure file sizes in mb instead of having to convert to kb. Co-authored-by: Ella <ella.estigoy@gmail.com>
This commit is contained in:
@ -55,6 +55,7 @@ class SiteSettings::TypeSupervisor
|
||||
emoji_list: 24,
|
||||
html_deprecated: 25,
|
||||
tag_group_list: 26,
|
||||
file_size_restriction: 27,
|
||||
)
|
||||
end
|
||||
|
||||
@ -180,7 +181,7 @@ class SiteSettings::TypeSupervisor
|
||||
end
|
||||
end
|
||||
|
||||
if type == :integer
|
||||
if type == :integer || type == :file_size_restriction
|
||||
result[:min] = @validators[name].dig(:opts, :min) if @validators[name].dig(
|
||||
:opts,
|
||||
:min,
|
||||
@ -304,6 +305,8 @@ class SiteSettings::TypeSupervisor
|
||||
GroupSettingValidator
|
||||
when self.class.types[:integer]
|
||||
IntegerSettingValidator
|
||||
when self.class.types[:file_size_restriction]
|
||||
IntegerSettingValidator
|
||||
when self.class.types[:regex]
|
||||
RegexSettingValidator
|
||||
when self.class.types[:string], self.class.types[:list], self.class.types[:enum]
|
||||
|
Reference in New Issue
Block a user