Fixed bool config having int value (#1708)

like DEBUG=1
This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி
2024-05-11 15:16:11 +05:30
committed by GitHub
parent 5244a34a1d
commit 24e61ead65

View File

@@ -192,7 +192,7 @@ def load_from_env(config: AppConfig, env_or_toml_dict: dict | os._Environ):
# Attempt to cast the env var to type hinted in the dataclass
if field_type is bool:
cast_value = value.lower() in ['true', '1']
cast_value = str(value).lower() in ['true', '1']
else:
cast_value = field_type(value)
setattr(sub_config, field_name, cast_value)