1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-11-03 04:17:21 -05:00

Fix crash on weird date time

Solution found by danschwarz
This commit is contained in:
Sandra Snan 2023-09-24 00:35:39 +02:00
parent f6e454956b
commit c821ab999b

View File

@ -394,7 +394,7 @@ def _convert(field_type, value):
return datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z")
if field_type == date:
return date.fromisoformat(value)
return datetime.fromisoformat(value).date()
if get_origin(field_type) == list:
(inner_type,) = get_args(field_type)