Skip to content

Commit 68e5299

Browse files
committed
fix(config): add correct handling of the bool values
1 parent e4a2cb6 commit 68e5299

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/poetry_plugin_dotenv/config.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ def __init__(self, working_dir: str) -> None:
6464
def _apply_source_config(self, source_config: dict[str, str | bool | None]) -> None:
6565
"""Apply source configuration to the instance."""
6666

67-
for attribute, default_value in self.__dataclass_fields__.items():
68-
source_value = source_config.get(attribute)
67+
for field in self.__dataclass_fields__.values():
68+
source_value = source_config.get(field.name)
6969

7070
if (
71-
isinstance(default_value.type, bool)
71+
isinstance(field.default, bool)
7272
and source_value
7373
and not isinstance(source_value, bool)
7474
):
7575
source_value = _as_bool(source_value)
7676

7777
if source_value is not None:
78-
setattr(self, attribute, source_value)
78+
setattr(self, field.name, source_value)
7979

8080

8181
def _load_config_from_toml(filepath: str, section: str) -> dict[str, str | bool | None]:

0 commit comments

Comments
 (0)