From db677c5e3fa3651ce9a40b2bd202159dda3ed21d Mon Sep 17 00:00:00 2001 From: Yiays Date: Mon, 28 Oct 2024 13:10:41 +1300 Subject: [PATCH] Fix confession assertion error --- extensions/confessions_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/confessions_common.py b/extensions/confessions_common.py index 9fa46a7..3402809 100644 --- a/extensions/confessions_common.py +++ b/extensions/confessions_common.py @@ -476,11 +476,11 @@ def create( if (author and not targetchannel) or (targetchannel and not author): raise Exception("Both author and targetchannel must be provided at the same time") if author: - if self.author and self.author != author: + if hasattr(self, 'author') and self.author != author: raise Exception("Attempted to change confession author from", self.author, "to", author, "!") self.author = author self.targetchannel = targetchannel - self.anonid = self.get_anonid(targetchannel.guild.id, self.author.id) + self.anonid = self.get_anonid(targetchannel.guild.id, author.id) guildchannels = get_guildchannels(self.config, targetchannel.guild.id) self.channeltype = guildchannels.get(targetchannel.id, ChannelType.unset) if reference: