ParasBotadra / django-email-confirmation

Automatically exported from code.google.com/p/django-email-confirmation
0 stars 0 forks source link

get rid of newlines in email subject #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In line 100 of models.py, a template is rendered to create the subject line
of the confirmation email.  Since it's easy to get a final newline in a
template file without intending to, it would be more robust if this line of
code stripped any newlines in the rendered template.  The following patch
takes care of it:

Index: devproject/emailconfirmation/models.py
===================================================================
--- devproject/emailconfirmation/models.py      (revision 40)
+++ devproject/emailconfirmation/models.py      (working copy)
@@ -97,7 +97,7 @@
             "current_site": current_site,
             "confirmation_key": confirmation_key,
         }
-        subject =
render_to_string("emailconfirmation/email_confirmation_subject.txt", context)
+        subject = '
'.join(render_to_string("emailconfirmation/email_confirmation_subject.txt",
context).splitlines())
         message =
render_to_string("emailconfirmation/email_confirmation_message.txt", context)
         send_mail(subject, message, settings.DEFAULT_FROM_EMAIL,
[email_address.email], priority="high")

Original issue reported on code.google.com by carl.j.meyer on 11 Jan 2009 at 4:28

GoogleCodeExporter commented 8 years ago
This one is very annoying. Can someone please apply this patch?

Original comment by augusto%...@gtempaccount.com on 19 Jan 2009 at 4:18

GoogleCodeExporter commented 8 years ago
Fixed in r42

Original comment by leidel on 21 Jan 2009 at 1:28