From 895bf7c972648dbc15148d4830cfb9155cfac86d Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 17 Jun 2024 16:29:19 +0100 Subject: [PATCH] Include airport countries in trip country list --- agenda/types.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agenda/types.py b/agenda/types.py index 2b759b6..b37f5ba 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -159,6 +159,19 @@ class Trip: assert country items.append(country) + for item in self.travel: + if item["type"] != "flight": + continue + + for key in "from_airport", "to_airport": + c = item[key]["country"] + if c in seen: + continue + seen.add(c) + country = agenda.get_country(c) + assert country + items.append(country) + return items @property