parent
3d16e30aa8
commit
cd0ffb3390
|
@ -261,7 +261,7 @@ def read_events_yaml(data_dir: str, start: date, end: date) -> list[Event]:
|
|||
return events
|
||||
|
||||
|
||||
def find_markets_during_stay(
|
||||
def find_events_during_stay(
|
||||
accommodation_events: list[Event], markets: list[Event]
|
||||
) -> list[Event]:
|
||||
"""Market events that happen during accommodation stays."""
|
||||
|
@ -451,11 +451,15 @@ async def get_data(
|
|||
events += domains.renewal_dates(my_data)
|
||||
|
||||
# hide markets that happen while away
|
||||
markets = [e for e in events if e.name == "market"]
|
||||
optional = [
|
||||
e
|
||||
for e in events
|
||||
if e.name == "market" or (e.title and "LHG Run Club" in e.title)
|
||||
]
|
||||
going = [e for e in events if e.going]
|
||||
|
||||
overlapping_markets = find_markets_during_stay(
|
||||
accommodation_events + going, markets
|
||||
overlapping_markets = find_events_during_stay(
|
||||
accommodation_events + going, optional
|
||||
)
|
||||
for market in overlapping_markets:
|
||||
events.remove(market)
|
||||
|
|
Loading…
Reference in a new issue