From ce9ca7914d20af403676550665301efd8452dc91 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 19 Nov 2023 08:41:42 -0300 Subject: [PATCH] gwr_advance_tickets can be None --- agenda/data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agenda/data.py b/agenda/data.py index e306d50..e9b2b28 100644 --- a/agenda/data.py +++ b/agenda/data.py @@ -232,7 +232,6 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]: my_data = config["data"]["personal-data"] events = ( [ - Event(name="gwr_advance_tickets", date=gwr_advance_tickets), Event(name="mothers_day", date=uk_holiday.get_mothers_day(today)), ] + timezone_transition(minus_365, plus_365, "uk_clock_change", "Europe/London") @@ -241,6 +240,9 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]: ) ) + if gwr_advance_tickets: + events.append(Event(name="gwr_advance_tickets", date=gwr_advance_tickets)) + events += combine_holidays(bank_holiday + get_us_holidays(last_year, next_year)) events += birthday.get_birthdays(last_year, os.path.join(my_data, "entities.yaml")) events += accommodation.get_events(os.path.join(my_data, "accommodation.yaml"))