From 1e9ae2091e6677c7164dd050b18c677628f7a2d1 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 16 Jan 2024 12:26:27 +0000 Subject: [PATCH] Show a geodesic line from LHR to the conference venue if no travel booked Closes: #111 --- agenda/trip.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/agenda/trip.py b/agenda/trip.py index 02c7775..4cf208a 100644 --- a/agenda/trip.py +++ b/agenda/trip.py @@ -191,7 +191,21 @@ def get_trip_routes(trip: Trip) -> list[StrDict]: } ) - return routes + if routes: + return routes + + lhr = (51.4775, -0.461389) + + return [ + { + "type": "flight", + "key": f'LHR_{item["location"]}_{item["country"]}', + "from": lhr, + "to": latlon_tuple(item), + } + for item in trip.conferences + if "latitude" in item and "longitude" in item and item["country"] != "gb" + ] def get_coordinates_and_routes(