sort vehicles by last activity

This commit is contained in:
Joachim Lusiardi 2024-05-25 17:53:51 +02:00
parent 208cb497aa
commit dfb07ae7ee

View File

@ -226,5 +226,6 @@ def get_pit_stops():
"regulars": vehicle.regulars,
}
user["vehicles"].append(v)
user["vehicles"].sort(key=lambda v: (v["data"][-1].date, v["data"][-1].odometer or 0 ), reverse=True)
return render_template("pitstops.html", user=user)