From 3fa8a616563f40b1fb65f5207a2be61fdaa639ab Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Sun, 29 Jan 2023 22:14:12 +0100 Subject: [PATCH] fix: 'NoneType' object has no attribute 'get_full_name'. Closes #10 --- mailing/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailing/models.py b/mailing/models.py index 1a2067d..5f0d8d8 100644 --- a/mailing/models.py +++ b/mailing/models.py @@ -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)