From 1ed6c50ad891a2583e8236547384aedbfdcea76a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 11 Mar 2024 10:46:18 +0100 Subject: [PATCH] Only show trains with a full departure datetime --- web_view.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web_view.py b/web_view.py index 8c744ab..468e58f 100755 --- a/web_view.py +++ b/web_view.py @@ -111,7 +111,11 @@ def travel_list() -> str: """Page showing a list of upcoming travel.""" data_dir = app.config["PERSONAL_DATA"] flights = travel.parse_yaml("flights", data_dir) - trains = travel.parse_yaml("trains", data_dir) + trains = [ + item + for item in travel.parse_yaml("trains", data_dir) + if isinstance(item["depart"], datetime) + ] return flask.render_template("travel.html", flights=flights, trains=trains)