Fix some instances where we use a non-role email for ADs in spite of them acting as ADs
- Legacy-Id: 3741
This commit is contained in:
parent
790d92622f
commit
3ed02196d7
|
@ -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 <ietf-secretariat-reply@ietf.org>",
|
||||
u"I-D was expired %s" % doc.file_tag(),
|
||||
|
|
|
@ -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 <iesg-secretary@ietf.org>",
|
||||
"%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):
|
||||
|
|
|
@ -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 <iesg@ietf.org>"
|
||||
|
||||
if request.method == 'POST':
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]))
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue