From 460e70a2f09de65bac12dd1f27f87f4190aa868b Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Sat, 25 May 2024 23:57:48 -0400 Subject: [PATCH] Ensure that report histories can only be generated for users who have submitted at least one report --- src/reports.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/reports.py b/src/reports.py index 1617668..e1625c8 100644 --- a/src/reports.py +++ b/src/reports.py @@ -576,6 +576,13 @@ async def callback(self, interaction: discord.Interaction): interaction.user.name, in_column=Column.DISCORD_NAME_COLUMN.value, ) + if name_cell is None: + await interaction.edit_original_response( + content="❌ We couldn't find your name in the main spreadsheet. Are you registered for EGN4912 and have you submitted a report this semester?", + attachments=[], + ) + return + # Get all values for this member row_values = await main_worksheet.row_values(name_cell.row) # Iterate through week columns