Skip to content

Commit 3ed0219

Browse files
committed
Fix some instances where we use a non-role email for ADs in spite of them acting as ADs
- Legacy-Id: 3741
1 parent 790d926 commit 3ed0219

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

ietf/idrfc/expire.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def send_expire_notice_for_idREDESIGN(doc):
147147
state = s.name if s else "I-D Exists"
148148

149149
request = None
150-
to = doc.ad.formatted_email()
150+
to = doc.ad.role_email("ad").formatted_email()
151151
send_mail(request, to,
152152
"I-D Expiring System <ietf-secretariat-reply@ietf.org>",
153153
u"I-D was expired %s" % doc.file_tag(),

ietf/idrfc/mails.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def email_owner(request, doc, owner, changed_by, text, subject=None):
5656
doc=doc,
5757
url=settings.IDTRACKER_BASE_URL + doc.idinternal.get_absolute_url()))
5858

59-
def email_ownerREDESIGN(request, doc, owner, changed_by, text, subject=None):
60-
if not owner or not changed_by or owner == changed_by:
59+
def email_adREDESIGN(request, doc, ad, changed_by, text, subject=None):
60+
if not ad or not changed_by or ad == changed_by:
6161
return
6262

63-
to = owner.formatted_email()
63+
to = ad.role_email("ad").formatted_email()
6464
send_mail(request, to,
6565
"DraftTracker Mail System <iesg-secretary@ietf.org>",
6666
"%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):
7070
url=settings.IDTRACKER_BASE_URL + doc.get_absolute_url()))
7171

7272
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
73-
email_owner = email_ownerREDESIGN
73+
email_owner = email_adREDESIGN
7474

7575

7676
def full_intended_status(intended_status):

ietf/idrfc/views_ballot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def send_ballot_commentREDESIGN(request, name):
477477
doc.revision_display = doc.rev
478478
body = render_to_string("idrfc/ballot_comment_mail.txt",
479479
dict(discuss=d, comment=c, ad=ad.name, doc=doc, pos=pos.pos))
480-
frm = ad.formatted_email()
480+
frm = ad.role_email("ad").formatted_email()
481481
to = "The IESG <iesg@ietf.org>"
482482

483483
if request.method == 'POST':

ietf/iesg/feeds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ def item_author_name(self, item):
4242
return str( item.job_owner )
4343
def item_author_email(self, item):
4444
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
45-
return item.ad.email_address()
45+
return item.ad.role_email("ad")
4646

4747
return item.job_owner.person.email()[1]

ietf/submit/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def test_submit_existing(self):
215215
self.assertTrue("New Version Notification" in outbox[-2]["Subject"])
216216
self.assertTrue(name in unicode(outbox[-2]))
217217
self.assertTrue("mars" in unicode(outbox[-2]))
218-
self.assertTrue(draft.ad.email_address().address in unicode(outbox[-2]))
218+
self.assertTrue(draft.ad.role_email("ad").address in unicode(outbox[-2]))
219219
self.assertTrue(ballot_position.ad.email_address().address in unicode(outbox[-2]))
220220
self.assertTrue("New Version Notification" in outbox[-1]["Subject"])
221221
self.assertTrue(name in unicode(outbox[-1]))

redesign/doc/proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def token_name(self):
326326
#token_email = models.CharField(blank=True, max_length=255)
327327
@property
328328
def token_email(self):
329-
return self.ad.email_address()
329+
return self.ad.role_email("ad")
330330

331331
#note = models.TextField(blank=True) # same name
332332

0 commit comments

Comments
 (0)