Commit dbfd1583 authored by Joshua Tauberer's avatar Joshua Tauberer

dont refresh the backup page when there's an error saving the config

parent 2b1f7da6
...@@ -384,7 +384,7 @@ def backup_set_custom(env, target, target_user, target_pass, min_age): ...@@ -384,7 +384,7 @@ def backup_set_custom(env, target, target_user, target_pass, min_age):
write_backup_config(env, config) write_backup_config(env, config)
return "Updated backup config" return "OK"
def get_backup_config(env, for_save=False, for_ui=False): def get_backup_config(env, for_save=False, for_ui=False):
backup_root = os.path.join(env["STORAGE_ROOT"], 'backup') backup_root = os.path.join(env["STORAGE_ROOT"], 'backup')
......
...@@ -202,11 +202,12 @@ function set_custom_backup() { ...@@ -202,11 +202,12 @@ function set_custom_backup() {
min_age: min_age min_age: min_age
}, },
function(r) { function(r) {
// Responses are multiple lines of pre-formatted text. // use .text() --- it's a text response, not html
show_modal_error("Backup configuration", $("<pre/>").text(r), function() { show_system_backup(); }); // refresh after modal show_modal_error("Backup configuration", $("<p/>").text(r), function() { if (r == "OK") show_system_backup(); }); // refresh after modal on success
}, },
function(r) { function(r) {
show_modal_error("Backup configuration (error)", r); // use .text() --- it's a text response, not html
show_modal_error("Backup configuration", $("<p/>").text(r));
}); });
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment