From 8583a0a09875ea0c4be6ab5125243bc8a0864421 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Sat, 21 Mar 2020 21:36:58 +0000 Subject: [PATCH] Use current email addresses when we have them when listing document authors. Fixes #1902. Commit ready for merge. - Legacy-Id: 17494 --- ietf/doc/models.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ietf/doc/models.py b/ietf/doc/models.py index d3dfe8bb5..222fbb1e3 100644 --- a/ietf/doc/models.py +++ b/ietf/doc/models.py @@ -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() ]