Fix wrong test on filtering user
All checks were successful
divent / lint (push) Successful in 2m6s
divent / docker (push) Successful in 2m10s
divent / pypi (push) Has been skipped

This commit is contained in:
Michel Roux 2023-11-07 02:37:08 +01:00
parent f7779ace60
commit 96ac519fde

View File

@ -303,10 +303,10 @@ async def ical(entity_id: str):
for guild in client.guilds: for guild in client.guilds:
if await guild.get_or_fetch_member(int(entity_id)): if await guild.get_or_fetch_member(int(entity_id)):
for scheduled_event in guild.scheduled_events: for scheduled_event in guild.scheduled_events:
if user.id in [ if any(
member.id user.id == member.id
for member in await scheduled_event.fetch_users().flatten() for member in await scheduled_event.fetch_users().flatten()
]: ):
event = make_event(scheduled_event) event = make_event(scheduled_event)
calendar.events.append(event) calendar.events.append(event)