Prevent an exception on missing author.email.person when listing author emails.

- Legacy-Id: 17554
This commit is contained in:
Henrik Levkowetz 2020-03-27 16:14:29 +00:00
parent 6fadf18ee9
commit 37f39163d1

View file

@ -379,7 +379,7 @@ class DocumentInfo(models.Model):
best_addresses = []
for author in self.documentauthor_set.all():
if author.email:
if author.email.active:
if author.email.active or not author.email.person:
best_addresses.append(author.email.address)
else:
best_addresses.append(author.email.person.email_address())