From 3a2b25d3bd29cb5ddc20abc942f00eeb5a794f99 Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Sat, 11 Aug 2018 18:57:33 +0200 Subject: [PATCH] fixes issue with first pitstop for a vehicle --- app/routes/pitstop.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/routes/pitstop.py b/app/routes/pitstop.py index c0e6c81..7861a06 100644 --- a/app/routes/pitstop.py +++ b/app/routes/pitstop.py @@ -67,8 +67,7 @@ def create_pit_stop_form(vid, cid): form.set_pitstops(vehicle.pitstops) form.same_odometer_allowed = (type(data[-1]) != Pitstop) or (data[-1].consumable.id != cid) else: - form.set_pitstop(Pitstop(date(1970, 1, 1), 0, vid, 0, '')) - form.set_pitstop(Pitstop(0, 0, date(1970, 1, 1), 0, cid)) + form.set_pitstops([Pitstop(date(1970, 1, 1), 0, vid, 0, ''),Pitstop(0, 0, date(1970, 1, 1), 0, cid)]) form.same_odometer_allowed = True # set the label of the litres field to make the user comfortable