Skip to content

Commit

Permalink
Fix confession assertion error
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed Oct 28, 2024
1 parent 001c2a0 commit db677c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/confessions_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit db677c5

Please sign in to comment.