From 7f21a1cf69fa6fb73f864eca45f598bec8af1161 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Thu, 22 Sep 2022 16:38:23 +0200 Subject: [PATCH] Defer faster, no longer error for courses than we don't know of --- didier/cogs/school.py | 10 +++++----- didier/data/embeds/schedules.py | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/didier/cogs/school.py b/didier/cogs/school.py index 877cc3f..aacdc4d 100644 --- a/didier/cogs/school.py +++ b/didier/cogs/school.py @@ -47,12 +47,12 @@ class School(commands.Cog): Schedules are personalized based on your roles in the server. If your schedule doesn't look right, make sure that you've got the correct roles selected. In case you do, ping D STIJN. """ - if day_dt is None: - day_dt = date.today() - - day_dt = skip_weekends(day_dt) - async with ctx.typing(): + if day_dt is None: + day_dt = date.today() + + day_dt = skip_weekends(day_dt) + try: member_instance = to_main_guild_member(self.client, ctx.author) diff --git a/didier/data/embeds/schedules.py b/didier/data/embeds/schedules.py index 9eefd61..ed03a33 100644 --- a/didier/data/embeds/schedules.py +++ b/didier/data/embeds/schedules.py @@ -190,8 +190,7 @@ async def parse_schedule_from_content(content: str, *, database_session: AsyncSe if code not in course_codes: course = await get_course_by_code(database_session, code) if course is None: - # raise ValueError(f"Unable to find course with code {code} (event {event.name})") # noqa: E800 - continue # TODO uncomment the line above after all courses have been added + continue course_codes[code] = course