Calculate last action date on OCD Bill and Event save #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request extends the post-save signals for OCD bills and events to also calculate and store the last action date for a bill. This logic was previously defined on the Metro bill model, however it will be useful across jurisdictions.
Note: We refresh the last action date on event save because event agenda items can influence the value of last action date.
Related issues
Connects opencivicdata/scrapers-us-municipal#300, Metro-Records/la-metro-councilmatic#541.
Testing instructions
django-councilmatic
.git clone https://github.com/datamade/la-metro-councilmatic.git
andcd
into the project directory.git checkout spike/hec/local-django-councilmatic
. Update the volume mount in the scraper service to point at your localdjango-councilmatic
directory.docker-compose build --no-cache scrapers
docker-compose run --rm scrapers sh -c "pupa update lametro bills window=7 --rpm=0 && pupa update lametro events window=14 --rpm=0"
. Confirm that they succeed.last_action_date
:docker-compose run --rm postgres psql -U postgres -d lametro postgres=# select count(*) from councilmatic_core_bill where last_action_date is not null;