From 9467d53142f8fe5526e1b9c5858165e5be6eced0 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Wed, 8 Feb 2012 14:05:33 +0000 Subject: [PATCH] Fix to-logic in generation of approval mail via RFC Editor - Legacy-Id: 3915 --- ietf/idrfc/mails.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/ietf/idrfc/mails.py b/ietf/idrfc/mails.py index 1bbf51b87..789cd71b9 100644 --- a/ietf/idrfc/mails.py +++ b/ietf/idrfc/mails.py @@ -352,22 +352,19 @@ def generate_approval_mail_rfc_editorREDESIGN(request, doc): doc_type = "RFC" if doc.get_state_slug() == "rfc" else "Internet Draft" to = [] - if doc.group: + if doc.group.type_id != "individ": for r in doc.group.role_set.filter(name="chair").select_related(): to.append(r.formatted_email()) - if doc.stream_id == "ise": - # include ISE chair - g = Group.objects.get(type='individ') - for r in g.role_set.filter(name="chair").select_related(): - to.append(r.formatted_email()) - elif doc.stream_id == "irtf": - # include IRTF chair - g = Group.objects.get(acronym='irtf') - for r in g.role_set.filter(name="chair").select_related(): - to.append(r.formatted_email()) - # and IRSG - to.append('"Internet Research Steering Group" ') + if doc.stream_id in ("ise", "irtf"): + # include ISE/IRTF chairs + g = Group.objects.get(acronym=doc.stream_id) + for r in g.role_set.filter(name="chair").select_related(): + to.append(r.formatted_email()) + + if doc.stream_id == "irtf": + # include IRSG + to.append('"Internet Research Steering Group" ') return render_to_string("idrfc/approval_mail_rfc_editor.txt", dict(doc=doc,