gwr_advance_tickets can be None

This commit is contained in:
Edward Betts 2023-11-19 08:41:42 -03:00
parent f5425a0564
commit ce9ca7914d

View file

@ -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"))