Skip to content

Fix datetime deserialization#5

Merged
vdurmont merged 1 commit intomainfrom
fix-datetime-deser
Oct 24, 2023
Merged

Fix datetime deserialization#5
vdurmont merged 1 commit intomainfrom
fix-datetime-deser

Conversation

@vdurmont
Copy link
Copy Markdown
Contributor

We used to just get the string value from the JSON and store it in the field. Now we properly deserialize it using datetime.fromisoformat.

@vdurmont vdurmont requested a review from jklein24 October 24, 2023 21:15
amount=CurrencyAmount_from_json(requester, obj["invoice_data_amount"]),
created_at=obj["invoice_data_created_at"],
expires_at=obj["invoice_data_expires_at"],
created_at=datetime.fromisoformat(obj["invoice_data_created_at"]),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we may need to import datetime too?

Copy link
Copy Markdown
Contributor Author

@vdurmont vdurmont Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! I missed it somehow :)

@vdurmont vdurmont merged commit 5e6714e into main Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants