Parcourir la source

Get rid of newlines in mail subjects

Baptiste Jonglez il y a 10 ans
Parent
commit
8800699558
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      coin/utils.py

+ 2 - 0
coin/utils.py

@@ -60,6 +60,8 @@ def send_templated_email(to, subject_template, body_template, context={}, attach
     # Get txt template for subject, fail if not exists
     subject_template = get_template('%s.txt' % (subject_template,))
     subject = subject_template.render(Context(context))
+    # Get rid of newlines
+    subject = subject.strip().replace('\n', '')
 
     # Try to get a txt version, convert from html to markdown style
     # (using html2text) if fail