exclude '\r' from subject_part

This is to prevent BadHeaderError("Header values can't contain newlines..
This commit is contained in:
Jenny Qian 2014-10-29 10:57:31 -05:00
parent 0d9446480e
commit 859935e5ee

View File

@ -115,7 +115,7 @@ def send_templated_mail(template_name, email_context, recipients, sender=None, b
elif type(recipients) != list:
recipients = [recipients,]
msg = EmailMultiAlternatives( subject_part.replace('\n', ''),
msg = EmailMultiAlternatives( subject_part.replace('\n', '').replace('\r', ''),
text_part,
sender,
recipients,