mirror of
https://github.com/netinvent/npbackup.git
synced 2025-11-17 14:19:48 +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.upload_speed",
|
||||||
"repo_opts.download_speed",
|
"repo_opts.download_speed",
|
||||||
):
|
):
|
||||||
if (
|
try:
|
||||||
full_config.g(inheritance_key) is not None
|
if (
|
||||||
and value is not None
|
full_config.g(inheritance_key) not in (None, "")
|
||||||
and (
|
and value not in (None, "")
|
||||||
BytesConverter(full_config.g(inheritance_key)).bytes
|
and (
|
||||||
== BytesConverter(value).bytes
|
BytesConverter(full_config.g(inheritance_key)).bytes
|
||||||
|
== BytesConverter(value).bytes
|
||||||
|
)
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
except ValueError as exc:
|
||||||
|
logger.debug(
|
||||||
|
f"BytesConverter could not convert value: {exc}"
|
||||||
)
|
)
|
||||||
):
|
pass
|
||||||
continue
|
|
||||||
|
|
||||||
# Don't bother to update empty strings, empty lists and None
|
# Don't bother to update empty strings, empty lists and None
|
||||||
# unless we have False, or 0, which or course need to be updated
|
# unless we have False, or 0, which or course need to be updated
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue