fix issue with creating the first ever pitstop for vehicle

This commit is contained in:
2018-08-11 19:38:51 +02:00
parent 889a3e6476
commit b3cb88e870
3 changed files with 25 additions and 13 deletions

View File

@@ -67,7 +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_pitstops([Pitstop(date(1970, 1, 1), 0, vid, 0, ''),Pitstop(0, 0, date(1970, 1, 1), 0, cid)])
form.set_pitstops([])
form.same_odometer_allowed = True
# set the label of the litres field to make the user comfortable