Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorstenFroehlinghaus committed Nov 6, 2024
1 parent 31ee8c5 commit e5bcf26
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/converters/gbfs_pickebike_basel_change_pricing_plan_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ def convert(self, data: Union[dict, list], path: str) -> Union[dict, list]:
if not isinstance(vehicles, list):
return data
for vehicle in vehicles:
if 'vehicle_type_id' not in vehicle:
continue
if 'pricing_plan_id' in vehicle and vehicle['pricing_plan_id'] == 'default_':
vehicle['pricing_plan_id'] = 'default_' + vehicle['vehicle_type_id']
if vehicle.get('pricing_plan_id') == 'default_':
vehicle['pricing_plan_id'] = 'default_' + vehicle.get('vehicle_type_id', '')
return data

return data

0 comments on commit e5bcf26

Please sign in to comment.