From 6ef1df2757dcbc8a1da231b52f07c1216731ac52 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sat, 10 Feb 2024 18:28:48 +0100 Subject: [PATCH] Fix parent stations for Transilien --- sncfgtfs/management/commands/update_sncf_gtfs.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sncfgtfs/management/commands/update_sncf_gtfs.py b/sncfgtfs/management/commands/update_sncf_gtfs.py index 207a0e4..ed71cc9 100644 --- a/sncfgtfs/management/commands/update_sncf_gtfs.py +++ b/sncfgtfs/management/commands/update_sncf_gtfs.py @@ -104,8 +104,7 @@ class Command(BaseCommand): zone_id=stop_dict.get('zone_id', ""), url=stop_dict.get('stop_url', ""), location_type=stop_dict.get('location_type', 1) or 1, - parent_station_id=stop_dict.get('parent_station', None) or None - if last_update_date != "1970-01-01" or transport_type != "TN" else None, + parent_station_id=stop_dict.get('parent_station', None) or None, timezone=stop_dict.get('stop_timezone', ""), wheelchair_boarding=stop_dict.get('wheelchair_boarding', 0), level_id=stop_dict.get('level_id', ""), @@ -114,17 +113,9 @@ class Command(BaseCommand): ) stops.append(stop) - if len(stops) >= bulk_size and not dry_run: - Stop.objects.bulk_create(stops, - update_conflicts=True, - update_fields=['name', 'desc', 'lat', 'lon', 'zone_id', 'url', - 'location_type', 'parent_station_id', 'timezone', - 'wheelchair_boarding', 'level_id', 'platform_code', - 'transport_type'], - unique_fields=['id']) - stops.clear() if stops and not dry_run: Stop.objects.bulk_create(stops, + batch_size=bulk_size, update_conflicts=True, update_fields=['name', 'desc', 'lat', 'lon', 'zone_id', 'url', 'location_type', 'parent_station_id', 'timezone',