FIX: ensure we have a bucket before enabling backups to S3
This commit is contained in:
parent
f2c1dbaa68
commit
5277ec1ac0
|
@ -1,4 +1,5 @@
|
|||
<label>
|
||||
{{input type="checkbox" checked=enabled}}
|
||||
{{{unbound setting.description}}}
|
||||
{{setting-validation-message message=validationMessage}}
|
||||
</label>
|
||||
|
|
|
@ -96,6 +96,7 @@ en:
|
|||
max_username_length_exists: "You cannot set the maximum username length below the longest username."
|
||||
max_username_length_range: "You cannot set the maximum below the minimum."
|
||||
default_categories_already_selected: "You cannot select a category used in another list."
|
||||
s3_upload_bucket_is_required: "You cannot enable uploads to S3 unless you've provided the 's3_upload_bucket'."
|
||||
|
||||
activemodel:
|
||||
errors:
|
||||
|
|
|
@ -46,4 +46,8 @@ module SiteSettingValidations
|
|||
validate_default_categories(new_val, default_categories_selected)
|
||||
end
|
||||
|
||||
def validate_enable_s3_uploads(new_val)
|
||||
validate_error :s3_upload_bucket_is_required if new_val == "t" && SiteSetting.s3_upload_bucket.blank?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue