Skip to content
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

Calculate last action date on OCD Bill and Event save #264

Merged
merged 2 commits into from
Jan 30, 2020

Conversation

hancush
Copy link
Member

@hancush hancush commented Jan 30, 2020

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

  • Check out this branch of django-councilmatic.
  • If you haven't already, clone LA Metro: git clone https://github.com/datamade/la-metro-councilmatic.git and cd into the project directory.
  • Switch to the local Councilmatic branch: git checkout spike/hec/local-django-councilmatic. Update the volume mount in the scraper service to point at your local django-councilmatic directory.
  • Build the scraper service: docker-compose build --no-cache scrapers
  • Run a bill and event scrape: 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.
  • Shell into your Councilmatic database and confirm that some bills have values for 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;

Copy link
Member

@fgregg fgregg left a comment

Choose a reason for hiding this comment

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

looks good.

@hancush hancush merged commit e7f1cbd into la_metro_accomodations Jan 30, 2020
@hancush hancush deleted the feature/hec/cache-last-action-date branch June 13, 2022 21:34
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