FIX: ensure we have a bucket before enabling backups to S3

This commit is contained in:
Régis Hanol 2015-09-16 15:55:26 +02:00
parent f2c1dbaa68
commit 5277ec1ac0
3 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,5 @@
<label>
{{input type="checkbox" checked=enabled}}
{{{unbound setting.description}}}
{{setting-validation-message message=validationMessage}}
</label>

View File

@ -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:

View File

@ -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