-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cast bill action dates to date objects, not date time objects #272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, one question.
return cls._cast(field, models.DateField()) | ||
|
||
@classmethod | ||
def cast_to_datetime(cls, field): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this path around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! We're still using it for event start dates, as well as membership start and end dates. We'll eventually transition membership start/end dates to date objects, but events actually come with a date time string, so we'll still use it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty.
Description
Bill action dates come to us as date strings. Originally, we cast them to date times, but this caused issues, as described in Metro-Records/la-metro-councilmatic#638.
This PR:
last_action_date
to aDateField
.to_datetime
util to coerce these date objects to date time objects where needed, predominantly infeeds.py
.We should treat this as a breaking change, in case downstream instances do anything with the last action date, e.g., in the Chicago search index definition.
Also, we should do this for memberships, too, but I want to do that separately for the sake of a neat diff and an expedient fix for action dates, which are displayed in lots of places, now. Opened #273 to track that work.
Testing instructions
N.b., I've already done this.
django-councilmatic
into a local install of Metro Councilmatic. Refresh the board report page and confirm that the date is one day later, i.e., the correct date. (You can verify this by calling up the board report in a Python shell.)