summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2011-09-18 12:12:47 -0500
committerDan McGee <dpmcgee@gmail.com>2011-09-18 12:12:47 -0500
commitedbb0dd22c62cf2997155145355fb405af23a399 (patch)
treeef6491034663adc07e31c79fc3448fed51c91ed7
parent3efb998c54401425340334d72d513194d07e049b (diff)
downloadwebsite-edbb0dd22c62cf2997155145355fb405af23a399.tar.gz
website-edbb0dd22c62cf2997155145355fb405af23a399.zip
Ensure email subject doesn't contain newlines
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
-rw-r--r--mycomments/signals.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mycomments/signals.py b/mycomments/signals.py
index 15efcc4..b407dad 100644
--- a/mycomments/signals.py
+++ b/mycomments/signals.py
@@ -32,10 +32,11 @@ def send_comment_by_mail(sender, **kwargs):
}
# write out a subject and body
subject = render_to_string('mycomments/email_subject.txt', content)
+ subject = subject.replace('\n', '').replace('\r', '').strip()
body = render_to_string('mycomments/email_body.txt', content)
# send the email
try:
- post.author.email_user(subject.strip(), body)
+ post.author.email_user(subject, body)
except socket.error, e:
# TODO really should have a logger or something here
if not e.errno == errno.ECONNREFUSED: