diff --git a/ietf/idrfc/expire.py b/ietf/idrfc/expire.py index e3cdd33f7..5a35dd05e 100644 --- a/ietf/idrfc/expire.py +++ b/ietf/idrfc/expire.py @@ -147,7 +147,7 @@ def send_expire_notice_for_idREDESIGN(doc): state = s.name if s else "I-D Exists" request = None - to = doc.ad.formatted_email() + to = doc.ad.role_email("ad").formatted_email() send_mail(request, to, "I-D Expiring System ", u"I-D was expired %s" % doc.file_tag(), diff --git a/ietf/idrfc/mails.py b/ietf/idrfc/mails.py index 6f5dc39d1..c649b12a7 100644 --- a/ietf/idrfc/mails.py +++ b/ietf/idrfc/mails.py @@ -56,11 +56,11 @@ def email_owner(request, doc, owner, changed_by, text, subject=None): doc=doc, url=settings.IDTRACKER_BASE_URL + doc.idinternal.get_absolute_url())) -def email_ownerREDESIGN(request, doc, owner, changed_by, text, subject=None): - if not owner or not changed_by or owner == changed_by: +def email_adREDESIGN(request, doc, ad, changed_by, text, subject=None): + if not ad or not changed_by or ad == changed_by: return - to = owner.formatted_email() + to = ad.role_email("ad").formatted_email() send_mail(request, to, "DraftTracker Mail System ", "%s updated by %s" % (doc.file_tag(), changed_by.name), @@ -70,7 +70,7 @@ def email_ownerREDESIGN(request, doc, owner, changed_by, text, subject=None): url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url())) if settings.USE_DB_REDESIGN_PROXY_CLASSES: - email_owner = email_ownerREDESIGN + email_owner = email_adREDESIGN def full_intended_status(intended_status): diff --git a/ietf/idrfc/views_ballot.py b/ietf/idrfc/views_ballot.py index 604142be4..a7d53b3dc 100644 --- a/ietf/idrfc/views_ballot.py +++ b/ietf/idrfc/views_ballot.py @@ -477,7 +477,7 @@ def send_ballot_commentREDESIGN(request, name): doc.revision_display = doc.rev body = render_to_string("idrfc/ballot_comment_mail.txt", dict(discuss=d, comment=c, ad=ad.name, doc=doc, pos=pos.pos)) - frm = ad.formatted_email() + frm = ad.role_email("ad").formatted_email() to = "The IESG " if request.method == 'POST': diff --git a/ietf/iesg/feeds.py b/ietf/iesg/feeds.py index bf0e89353..d76d81d73 100644 --- a/ietf/iesg/feeds.py +++ b/ietf/iesg/feeds.py @@ -42,6 +42,6 @@ class IESGAgenda(Feed): return str( item.job_owner ) def item_author_email(self, item): if settings.USE_DB_REDESIGN_PROXY_CLASSES: - return item.ad.email_address() + return item.ad.role_email("ad") return item.job_owner.person.email()[1] diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index 053d23913..4551348e4 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -215,7 +215,7 @@ class SubmitTestCase(django.test.TestCase): self.assertTrue("New Version Notification" in outbox[-2]["Subject"]) self.assertTrue(name in unicode(outbox[-2])) self.assertTrue("mars" in unicode(outbox[-2])) - self.assertTrue(draft.ad.email_address().address in unicode(outbox[-2])) + self.assertTrue(draft.ad.role_email("ad").address in unicode(outbox[-2])) self.assertTrue(ballot_position.ad.email_address().address in unicode(outbox[-2])) self.assertTrue("New Version Notification" in outbox[-1]["Subject"]) self.assertTrue(name in unicode(outbox[-1])) diff --git a/redesign/doc/proxy.py b/redesign/doc/proxy.py index dd0c7dcb8..64dda48ed 100644 --- a/redesign/doc/proxy.py +++ b/redesign/doc/proxy.py @@ -326,7 +326,7 @@ class InternetDraft(Document): #token_email = models.CharField(blank=True, max_length=255) @property def token_email(self): - return self.ad.email_address() + return self.ad.role_email("ad") #note = models.TextField(blank=True) # same name