Updates create pitstop form

The form now uses the new odometer_date_check to allow entering
pitstops that are before the currently last pitstop.
This commit is contained in:
2018-08-11 14:53:08 +02:00
parent 25705562ad
commit 13090d2735
2 changed files with 10 additions and 15 deletions

View File

@@ -64,7 +64,7 @@ def create_pit_stop_form(vid, cid):
data = get_event_line_for_vehicle(vehicle)
if len(data) > 0:
form.set_pitstop(Pitstop(data[-1].odometer, 0, data[-1].date, 0, 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, ''))