parent
2744f67987
commit
a9c9c719a4
|
@ -237,10 +237,15 @@ def trip_list() -> str:
|
||||||
|
|
||||||
@app.route("/trip/<start>")
|
@app.route("/trip/<start>")
|
||||||
def trip_page(start: str) -> str:
|
def trip_page(start: str) -> str:
|
||||||
|
"""Individual trip page."""
|
||||||
trip_list = build_trip_list()
|
trip_list = build_trip_list()
|
||||||
today = date.today()
|
today = date.today()
|
||||||
|
|
||||||
trip = next((trip for trip in trip_list if trip.start.isoformat() == start), None)
|
trip = next((trip for trip in trip_list if trip.start.isoformat() == start), None)
|
||||||
|
|
||||||
|
if not trip:
|
||||||
|
flask.abort(404)
|
||||||
|
|
||||||
return flask.render_template(
|
return flask.render_template(
|
||||||
"trip_page.html",
|
"trip_page.html",
|
||||||
trip=trip,
|
trip=trip,
|
||||||
|
|
Loading…
Reference in a new issue