diff --git a/app/tools.py b/app/tools.py index 7936153..e7ff34a 100644 --- a/app/tools.py +++ b/app/tools.py @@ -204,7 +204,9 @@ def compute_lower_limits_for_new_pitstop( def pitstop_service_key(x): - return x.date, x.odometer + # if the entry got no odometer (regular costs!) then we assume it's okay + # to have regular cost at a virtual odometer of 0 on that day. + return x.date, x.odometer or 0 def get_event_line_for_vehicle(vehicle):