Skip to content

Commit

Permalink
Update settings.py (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
attzonko authored Apr 5, 2021
1 parent e0e63f9 commit 72727c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mmpy_bot/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ def _set_field(self, f, value: str):
)
# Use get_args to find out what kind of sequence it is.
value = _get_comma_separated_list(value, type=get_args(f.type)[0])
elif f.type in [int, float, str, bool]: # type: ignore
elif f.type in [int, float, str]: # type: ignore
value = f.type(value)
elif f.type is bool:
value = f.type(value.lower() in ("yes", "y", "true", "1"))
else:
raise TypeError(
f"Attribute {f.name} has type {f.type}, which is not supported."
Expand Down

0 comments on commit 72727c6

Please sign in to comment.