diff --git a/web_view.py b/web_view.py index 296c670..6944841 100755 --- a/web_view.py +++ b/web_view.py @@ -613,18 +613,19 @@ def trip_stats() -> str: """Travel stats: distance and price by year and travel type.""" route_distances = agenda.travel.load_route_distances(app.config["DATA_DIR"]) trip_list = get_trip_list(route_distances) - today = date.today() - past = [item for item in trip_list if (item.end or item.start) < today] - conferences = sum(len(item.conferences) for item in past) + # today = date.today() + # past = [item for item in trip_list if (item.end or item.start) < today] - yearly_stats = agenda.trip.calculate_yearly_stats(past) + conferences = sum(len(item.conferences) for item in trip_list) + + yearly_stats = agenda.trip.calculate_yearly_stats(trip_list) return flask.render_template( "trip/stats.html", - count=len(past), - total_distance=calc_total_distance(past), - distances_by_transport_type=sum_distances_by_transport_type(past), + count=len(trip_list), + total_distance=calc_total_distance(trip_list), + distances_by_transport_type=sum_distances_by_transport_type(trip_list), yearly_stats=yearly_stats, conferences=conferences, )