Fix attributeerror

This commit is contained in:
nex 2022-11-08 12:27:29 +00:00
parent 1076ab4eca
commit 990343e711

View file

@ -382,7 +382,10 @@ class AssignmentsCog(commands.Cog):
assignment: Assignments = await get_or_none(Assignments, entry_id=int(entry_id))
if not assignment:
return await ctx.respond("\N{cross mark} Unknown assignment.")
await assignment.created_by.load()
try:
await assignment.created_by.load()
except AttributeError as e:
console.log(f"[red]Failed to load created_by row for assignment {assignment}: {e}")
cog = self
class EditAssignmentView(discord.ui.View):