mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-11 14:42:37 +08:00
GUI: Fix #156 when setting empty strings
This commit is contained in:
parent
0ed031a790
commit
4d6c48e91f
1 changed files with 14 additions and 8 deletions
|
|
@ -838,15 +838,21 @@ def config_gui(full_config: dict, config_file: str):
|
|||
"repo_opts.upload_speed",
|
||||
"repo_opts.download_speed",
|
||||
):
|
||||
if (
|
||||
full_config.g(inheritance_key) is not None
|
||||
and value is not None
|
||||
and (
|
||||
BytesConverter(full_config.g(inheritance_key)).bytes
|
||||
== BytesConverter(value).bytes
|
||||
try:
|
||||
if (
|
||||
full_config.g(inheritance_key) not in (None, "")
|
||||
and value not in (None, "")
|
||||
and (
|
||||
BytesConverter(full_config.g(inheritance_key)).bytes
|
||||
== BytesConverter(value).bytes
|
||||
)
|
||||
):
|
||||
continue
|
||||
except ValueError as exc:
|
||||
logger.debug(
|
||||
f"BytesConverter could not convert value: {exc}"
|
||||
)
|
||||
):
|
||||
continue
|
||||
pass
|
||||
|
||||
# Don't bother to update empty strings, empty lists and None
|
||||
# unless we have False, or 0, which or course need to be updated
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue