fix: restore toggle & get previous behavior

This commit is contained in:
mathieui 2021-03-26 12:41:42 +01:00
parent c0c0155ba3
commit 84afe4938d

View file

@ -203,9 +203,7 @@ class Config:
returned
"""
if default is None:
section_val = self.default.get(section)
if section_val is not None:
default = section_val.get(option)
default = self.default.get(section, {}).get(option, '')
res: Optional[ConfigValue]
try:
@ -483,7 +481,7 @@ class Config:
if isinstance(value, str) and value == "toggle":
current = self.getbool(option, section)
if isinstance(current, bool):
value = str(not current)
value = str(not current).lower()
else:
if current.lower() == "false":
value = "true"