Fix malfunction when setting value of key "old" to zero (Thank you roughnecks).
This commit is contained in:
parent
8e76ae4506
commit
7c197c2343
1 changed files with 8 additions and 2 deletions
|
@ -2503,8 +2503,14 @@ async def set_setting_value(db_file, key_value):
|
||||||
logger.debug('{}: db_file: {} key: {} val: {}'
|
logger.debug('{}: db_file: {} key: {} val: {}'
|
||||||
.format(function_name, db_file, key, val))
|
.format(function_name, db_file, key, val))
|
||||||
|
|
||||||
if not val:
|
# NOTE This is not a good practice!
|
||||||
raise Exception('Missing value for key "{}" ({}).'.format(key, db_file))
|
# When INI file was used, all values were strings.
|
||||||
|
# When TOML is now used, integers are integers, which means that
|
||||||
|
# statement "if not val" is equivalent to "if not 0" which is not so to
|
||||||
|
# statement "if not '0'"
|
||||||
|
|
||||||
|
# if not val:
|
||||||
|
# raise Exception('Missing value for key "{}" ({}).'.format(key, db_file))
|
||||||
# logger.error('Missing value for key "{}" ({}).'.format(key, db_file))
|
# logger.error('Missing value for key "{}" ({}).'.format(key, db_file))
|
||||||
# return
|
# return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue