From 2d31924937b78a8e57a7b7418ba69e217dc36180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20Fr=C3=B6hlinghaus?= Date: Fri, 6 Dec 2024 17:42:49 +0100 Subject: [PATCH] correct vehicle_types logic --- app/converters/gbfs_voi_de_remove_bicycle.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/converters/gbfs_voi_de_remove_bicycle.py b/app/converters/gbfs_voi_de_remove_bicycle.py index 6eab97d..de8d10d 100644 --- a/app/converters/gbfs_voi_de_remove_bicycle.py +++ b/app/converters/gbfs_voi_de_remove_bicycle.py @@ -21,11 +21,12 @@ def convert(self, data: Union[dict, list], path: str) -> Union[dict, list]: vehicle_types = fields.get('vehicle_types', []) if not isinstance(vehicle_types, list): return data - newdata = [] + newlist = [] for vehicle_type in vehicle_types: if vehicle_type.get('vehicle_type_id') != 'voi_bike': - newdata.append(vehicle_type) - return newdata + newlist.append(vehicle_type) + fields['vehicle_types'] = newlist + return data if path.endswith('/station_status.json'): fields = data.get('data', {})