fix: disabled choices must not generate error when loaded from .rougailcli.yml
This commit is contained in:
parent
8f81df6909
commit
e77b65ffd5
1 changed files with 8 additions and 5 deletions
|
|
@ -468,11 +468,14 @@ def convert_value(option, value, needs_convert):
|
||||||
except:
|
except:
|
||||||
return value
|
return value
|
||||||
if option_type == "choice":
|
if option_type == "choice":
|
||||||
choices = option.value.list()
|
try:
|
||||||
if value not in choices and isinstance(value, str):
|
choices = option.value.list()
|
||||||
# FIXME add other tests (boolean, float, ...)
|
if value not in choices and isinstance(value, str):
|
||||||
if value.isnumeric() and int(value) in choices:
|
# FIXME add other tests (boolean, float, ...)
|
||||||
value = int(value)
|
if value.isnumeric() and int(value) in choices:
|
||||||
|
value = int(value)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
func = CONVERT_OPTION.get(option_type, {}).get("func")
|
func = CONVERT_OPTION.get(option_type, {}).get("func")
|
||||||
if func:
|
if func:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue