make it work with bare bool as well

This commit is contained in:
Benedikt Bartscher 2024-10-20 17:58:33 +02:00
parent 274da16676
commit c74e8b97bc
No known key found for this signature in database

View File

@ -300,7 +300,9 @@ class Config(Base):
# Convert the env var to the expected type.
try:
if issubclass(field.type_, type) and issubclass(field.type_, bool):
if field.type_ == bool or (
issubclass(field.type_, type) and issubclass(field.type_, bool)
):
# special handling for bool values
env_var = env_var.lower() in ["true", "1", "yes"]
else: