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

Out of council boundary imports #7764

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GeoWill
Copy link
Collaborator

@GeoWill GeoWill commented Jun 13, 2024

No description provided.

@GeoWill GeoWill force-pushed the feature/out-of-boundary-imports branch from 8689f7c to 47950ea Compare June 14, 2024 14:28
@GeoWill GeoWill force-pushed the feature/out-of-boundary-imports branch from 47950ea to 6d411fb Compare June 15, 2024 11:01
@GeoWill GeoWill changed the title WiP Out of council boundary imports Jun 15, 2024
Comment on lines +395 to +413
self.set_polling_station_for_extra_councils(
polling_station_id, uprns_assigned_to_station
)

uprns_assigned_to_station.filter(uprn__in=uprns).update(
polling_station_id=polling_station_id
)

def set_polling_station_for_extra_councils(
self, polling_station_id, uprns_assigned_to_station
):
# At this stage we want to know if the station has the right council id.
# There are three cases:
# 1. All the addresses are in the council named in the import script.
# So the station will have the correct council_id and no action is necessary.
# 2. All the addresses are in a different council.
# In this case we need to update the council_id on the polling station in the pollingstations table
# 3. The addresses assigned to this station are in different council areas.
# In this case we need to duplicate the station making sure there are a record for each council_id.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This approach won't work, because the polling stations aren't saved in the DB yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant