From 786fc3823599d68d04a9eaf3d81e98f883763bea Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Mon, 26 Jan 2015 22:25:38 +0000 Subject: [PATCH] Improve the approval mail contents concerning IESG contact members. Fixes #1588. Commit ready for merge. - Legacy-Id: 8923 --- ietf/doc/mails.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ietf/doc/mails.py b/ietf/doc/mails.py index 99d6d5af4..3903ad35a 100644 --- a/ietf/doc/mails.py +++ b/ietf/doc/mails.py @@ -189,13 +189,15 @@ def generate_approval_mail_approved(request, doc): else: made_by = "This document is the product of the %s." % doc.group.name_with_wg - director = doc.ad - other_director = Person.objects.filter(role__group__role__person=director, role__group__role__name="ad").exclude(pk=director.pk) + responsible_directors = set([doc.ad,]) + if doc.group.type_id not in ("individ","area"): + responsible_directors.update([x.person for x in Role.objects.filter(group=doc.group.parent,name='ad')]) + responsible_directors = [x.plain_name() for x in responsible_directors if x] - if doc.group.type_id not in ("individ", "area") and other_director: - contacts = "The IESG contact persons are %s and %s." % (director.plain_name(), other_director[0].plain_name()) + if len(responsible_directors)>1: + contacts = "The IESG contact persons are "+", ".join(responsible_directors[:-1])+" and "+responsible_directors[-1]+"." else: - contacts = "The IESG contact person is %s." % director.plain_name() + contacts = "The IESG contact person is %s." % responsible_directors[0] doc_type = "RFC" if doc.get_state_slug() == "rfc" else "Internet Draft"