From 25236854c56290fb529d227cfc82b8a447d0d16c Mon Sep 17 00:00:00 2001 From: Florian Bezannier Date: Thu, 15 Apr 2021 14:30:38 +0200 Subject: [PATCH] check len of trips --- web/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/views.py b/web/views.py index 313725b..7d45ed7 100644 --- a/web/views.py +++ b/web/views.py @@ -175,12 +175,11 @@ def update_trips(): try: trips_by_vin = Trips.get_trips(myp.vehicles_list) trips = next(iter(trips_by_vin.values())) # todo handle multiple car + assert len(trips) > 0 chargings = MyPSACC.get_chargings() - except StopIteration: + except (StopIteration, AssertionError): logger.debug("No trips yet") return - except AssertionError: - logger.error("update_trips: %s", traceback.format_exc()) # update for slider global min_date, max_date, min_millis, max_millis, step, marks try: