Skip to content

Commit e20e8b7

Browse files
committed
Changed the mail sending routines so it's possible to not copy the debug archive on some messages.
- Legacy-Id: 15585
1 parent 47c6088 commit e20e8b7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ietf/nomcom/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def save(self, commit=True):
530530
}
531531
path = nomcom_template_path + FEEDBACK_RECEIPT_TEMPLATE
532532
# TODO - make the thing above more generic
533-
send_mail(None, to_email, from_email, subject, path, context, cc=cc)
533+
send_mail(None, to_email, from_email, subject, path, context, cc=cc, copy=False)
534534

535535
class Meta:
536536
model = Feedback

ietf/utils/mail.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ def encode_message(txt):
179179
assert isinstance(txt, unicode)
180180
return MIMEText(txt.encode('utf-8'), 'plain', 'UTF-8')
181181

182-
def send_mail_text(request, to, frm, subject, txt, cc=None, extra=None, toUser=False, bcc=None):
182+
def send_mail_text(request, to, frm, subject, txt, cc=None, extra=None, toUser=False, bcc=None, copy=True):
183183
"""Send plain text message."""
184184
msg = encode_message(txt)
185-
return send_mail_mime(request, to, frm, subject, msg, cc, extra, toUser, bcc)
185+
return send_mail_mime(request, to, frm, subject, msg, cc, extra, toUser, bcc, copy=copy)
186186

187187
def formataddr(addrtuple):
188188
"""
@@ -255,7 +255,7 @@ def show_that_mail_was_sent(request,leadline,msg,bcc):
255255
info += "Bcc: %s\n" % bcc
256256
messages.info(request,info,extra_tags='preformatted',fail_silently=True)
257257

258-
def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=False, bcc=None):
258+
def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=False, bcc=None, copy=True):
259259
"""Send MIME message with content already filled in."""
260260

261261
condition_message(to, frm, subject, msg, cc, extra)
@@ -287,7 +287,7 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F
287287
copy_to = settings.EMAIL_COPY_TO
288288
except AttributeError:
289289
copy_to = "ietf.tracker.archive+%s@gmail.com" % settings.SERVER_MODE
290-
if copy_to and not test_mode and not debugging: # if we're running automated tests, this copy is just annoying
290+
if copy and copy_to and not test_mode and not debugging: # if we're running automated tests, this copy is just annoying
291291
if bcc:
292292
msg['X-Tracker-Bcc']=bcc
293293
try:

0 commit comments

Comments
 (0)