From 049b649eb76ae4409bb53acd65f1330fd9d4e0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20A=2E=20S=C3=A1nchez=20L=C3=B3pez?= Date: Mon, 17 Jan 2011 19:49:00 +0000 Subject: [PATCH] Notify shepherd (and wg chairs and delegates) by email if 'Doc Shepherd Follow-up Underway' is updated. Fixes #561 - Legacy-Id: 2748 --- ietf/ietfworkflows/utils.py | 1 - ietf/wgchairs/forms.py | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ietf/ietfworkflows/utils.py b/ietf/ietfworkflows/utils.py index e0a10ffb3..1ec56558c 100644 --- a/ietf/ietfworkflows/utils.py +++ b/ietf/ietfworkflows/utils.py @@ -146,7 +146,6 @@ def notify_entry(entry, template, extra_notify=[]): to=mail_list, from_email=settings.DEFAULT_FROM_EMAIL) # Only send emails if we are not debug mode - print body if not settings.DEBUG: mail.send() return mail diff --git a/ietf/wgchairs/forms.py b/ietf/wgchairs/forms.py index fa7dcf3cc..2d12e1bd1 100644 --- a/ietf/wgchairs/forms.py +++ b/ietf/wgchairs/forms.py @@ -346,6 +346,7 @@ class WriteUpEditForm(RelatedWGForm): else: self.doc_writeup=None super(WriteUpEditForm, self).__init__(*args, **kwargs) + self.person = get_person_for_user(self.user) def get_writeup(self): return self.data.get('writeup', self.doc_writeup and self.doc_writeup.writeup or '') @@ -353,7 +354,7 @@ class WriteUpEditForm(RelatedWGForm): def save(self): if not self.doc_writeup: self.doc_writeup = ProtoWriteUp.objects.create( - person=get_person_for_user(self.user), + person=self.person, draft=self.doc, writeup=self.cleaned_data['writeup']) else: @@ -362,10 +363,15 @@ class WriteUpEditForm(RelatedWGForm): if self.data.get('modify_tag', False): followup = self.cleaned_data.get('followup', False) comment = self.cleaned_data.get('comment', False) - if followup: - update_tags(self.doc, comment, set_tags=[FOLLOWUP_TAG]) + shepherd = self.doc.shepherd + if shepherd: + extra_notify = ['%s <%s>' % shepherd.email()] else: - update_tags(self.doc, comment, reset_tags=[FOLLOWUP_TAG]) + extra_notify = [] + if followup: + update_tags(self.doc, comment, self.person, set_tags=[FOLLOWUP_TAG], extra_notify=extra_notify) + else: + update_tags(self.doc, comment, self.person, reset_tags=[FOLLOWUP_TAG], extra_notify=extra_notify) return self.doc_writeup def is_valid(self):