Install Councilmatic in pupa settings file #35
Merged
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.
Overview
A long time ago, in a galaxy far away, we used one scraper repository for many jurisdictional scrapers. These scrapers shared a pupa settings file that needed to account for some jurisdictions scraping into a plain OCD database, while others scraped into a Councilmatic database. Thus, we introduced a
SHARED_DB
environment variable that, if true, would includecouncilmatic_core
in installed apps.The script we use to run scrapes sets the
SHARED_DB
variable, but it was not set for the pupa clean DAG, so thecouncilmatic_core
app was not installed. This resulted in the deletion of top-level entities like organizations and people behaving badly, i.e., not cascading as configured in the Councilmatic app.This PR does away with the conditional behavior in the settings file. The Metro scrapers are always running against a shared DB.
Connects datamade/django-councilmatic#293
Notes
Once this is merged and the main tag builds, we should be able to run the cleanup DAG on the staging dashboard without error.
Testing Instructions
Ran locally against the staging database to confirm this works!