Skip to content

Commit

Permalink
DBC22-1884: rest stop ID fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd authored and fatbird committed Apr 3, 2024
1 parent df96c42 commit 47adae1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/backend/apps/rest/management/commands/purge_rest_stops.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from apps.rest.models import RestStop
from django.core.management.base import BaseCommand


class Command(BaseCommand):
def handle(self, *args, **options):
RestStop.objects.all().delete()
5 changes: 3 additions & 2 deletions src/backend/apps/rest/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@


def populate_rest_stop_from_data(new_rest_stop_data):
rest_stop_id = new_rest_stop_data.get('rest_stop_id')
geometry = new_rest_stop_data.get('geometry')
properties = new_rest_stop_data.get('properties')
rest_stop_id = properties.get('CHRIS_REST_AREA_ID')

existing_record = RestStop.objects.filter(rest_stop_id=rest_stop_id).first()
data = {
'rest_stop_id': rest_stop_id,
'geometry': geometry,
'properties': new_rest_stop_data.get('properties'),
'properties': properties,
'bbox': new_rest_stop_data.get('bbox'),
}

Expand Down

0 comments on commit 47adae1

Please sign in to comment.