Skip to content

Conversation

@awdem
Copy link
Contributor

@awdem awdem commented Oct 23, 2025

The recent django 5.2 upgrade to leaflets changed the API to include timezone info in datetime string representations.

This broke the WCIVF leaflet importer because we were assuming naive datetimes.

This PR fixes that by using the dateutils parser to parse the date_uploaded field. It also adds some tests that include the two str formats that I encountered, plus a naive datetime. It's possible there are other formats in the database, but I'm not sure what they might be.


@awdem awdem changed the title Fix/import leaflets fix leaflet importer Oct 23, 2025
@sentry
Copy link

sentry bot commented Oct 23, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: wcivf/apps/leaflets/management/commands/import_leaflets.py

Function Unhandled Issue
add_leaflets ValueError: unconverted data remains: Z WCIVFCont...
Event Count: 175

@coveralls
Copy link

Coverage Status

coverage: 58.523% (+0.4%) from 58.173%
when pulling 7a503c6 on fix/import_leaflets
into 0edfca5 on master.

@awdem awdem marked this pull request as ready for review October 23, 2025 11:58
Copy link
Member

@chris48s chris48s left a comment

Choose a reason for hiding this comment

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

nice 👍

@awdem awdem merged commit 93f73a9 into master Oct 23, 2025
5 checks passed
@awdem awdem deleted the fix/import_leaflets branch October 23, 2025 15:41
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.

3 participants