Код: Выделить всё
# Delete Route for a particular trip
@app.route('/trips/', methods=['DELETE'])
def delete_trip(trip_id):
trip = trips.get(trip_id) #the trip refers to particualar trip to delete..actually to be queried from the database
del trips[trip] # logic to delete a trip
return jsonify({'message': 'Trip deleted successfully!'})
Файл " E:\Wlink\Location_Tra\backend\main.py", строка 654, в delete_trip
del trips[trip] # логика для удаления поездки
KeyError: None< /p>

Подробнее здесь: https://stackoverflow.com/questions/787 ... -in-python