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

This commit is contained in:
Julien Palard 2023-01-29 22:14:12 +01:00
parent 9292862fe4
commit 3fa8a61656
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
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)