mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-23 02:27:05 +00:00
Write rsync settings before validating
I understand the philosophy behind not saving until validated, but there are many examples in software where this is not true. For instance, setting up a mail account in Thunderbird or outlook. You can use the wrong settings on initial setup (indeed, outlook forces you to in some circumstances) then go repair them later. This also solves the second issue I raised in mail-in-a-box#1624 because running backup.py --validate will try to use the new settings, just like the Unkown Error case error message implies it should.
This commit is contained in:
parent
e37768ca86
commit
a277d4bcc7
@ -473,6 +473,8 @@ def backup_set_custom(env, target, target_user, target_pass, min_age):
|
|||||||
config["target_pass"] = target_pass
|
config["target_pass"] = target_pass
|
||||||
config["min_age_in_days"] = min_age
|
config["min_age_in_days"] = min_age
|
||||||
|
|
||||||
|
write_backup_config(env, config)
|
||||||
|
|
||||||
# Validate.
|
# Validate.
|
||||||
try:
|
try:
|
||||||
if config["target"] not in ("off", "local"):
|
if config["target"] not in ("off", "local"):
|
||||||
@ -482,8 +484,6 @@ def backup_set_custom(env, target, target_user, target_pass, min_age):
|
|||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
return str(e)
|
return str(e)
|
||||||
|
|
||||||
write_backup_config(env, config)
|
|
||||||
|
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
def get_backup_config(env, for_save=False, for_ui=False):
|
def get_backup_config(env, for_save=False, for_ui=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user