Merged in [17494] from rjsparks@nostrum.com:

Use current email addresses when we have them when listing document authors. Fixes #1902.
 - Legacy-Id: 17516
Note: SVN reference [17494] has been migrated to Git commit 8583a0a098
This commit is contained in:
Henrik Levkowetz 2020-03-22 23:55:49 +00:00
commit 970248a3d6

View file

@ -377,7 +377,14 @@ class DocumentInfo(models.Model):
return self.rfc_number()
def author_list(self):
return ", ".join(author.email_id for author in self.documentauthor_set.all() if author.email_id)
best_addresses = []
for author in self.documentauthor_set.all():
if author.email:
if author.email.active:
best_addresses.append(author.email.address)
else:
best_addresses.append(author.email.person.email_address())
return ", ".join(best_addresses)
def authors(self):
return [ a.person for a in self.documentauthor_set.all() ]