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

Allow a little more distance between polling places #3138

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions django/demsausage/app/sausage/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
from demsausage.rq.jobs import task_regenerate_cached_election_data
from demsausage.util import (convert_string_to_number, get_env, is_numeric,
make_logger, merge_and_sum_dicts)
from rq import get_current_job

from django.contrib.gis.geos import Point
from django.db import transaction
from django.db.models import Q
from rq import get_current_job

logger = make_logger(__name__)

Expand Down Expand Up @@ -706,7 +707,7 @@ def _fetch_matching(polling_place):
return results
else:
self.logger.info(f"Doing noms migration by distance for {polling_place.name}")
return self.safe_find_by_distance("Noms Migration", polling_place.geom, distance_threshold_km=0.1, limit=None, qs=PollingPlaces.objects.filter(election=self.election, status=PollingPlaceStatus.DRAFT))
return self.safe_find_by_distance("Noms Migration", polling_place.geom, distance_threshold_km=0.125, limit=None, qs=PollingPlaces.objects.filter(election=self.election, status=PollingPlaceStatus.DRAFT))

# Migrate polling places with attached noms (and their stalls)
queryset = PollingPlaces.objects.filter(election=self.election, status=PollingPlaceStatus.ACTIVE, noms__isnull=False)
Expand Down