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:
@@ -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, ''))
|
||||
|
||||
Reference in New Issue
Block a user