Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 5be5e6f

Browse files
committed
Be a bit more understanding of the datetime string in payments dates
1 parent 9073fc1 commit 5be5e6f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

duffel_api/models/offer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ def from_json(cls, json: dict):
9696
"""Construct a class instance from a JSON response."""
9797
return cls(
9898
payment_required_by=get_and_transform(
99-
json,
100-
"payment_required_by",
101-
lambda value: datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ"),
99+
json, "payment_required_by", parse_datetime
102100
),
103101
price_guarantee_expires_at=get_and_transform(
104102
json,

0 commit comments

Comments
 (0)