fix: 'NoneType' object has no attribute 'get_full_name'. Closes #10 #11

Merged
mdk merged 1 commits from mdk/PonyConf:mdk-NoneType into main 2023-01-29 21:21:30 +00:00
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class MessageAuthor(models.Model):
def __str__(self):
author_class = self.author_type.model_class()
if author_class == get_user_model():
if self.author is not None and author_class == get_user_model():
return self.author.get_full_name()
else:
return str(self.author)