Skip to content
Snippets Groups Projects
Commit ae638318 authored by Ben Adida's avatar Ben Adida
Browse files

made email addresses safer

parent 2cb04d63
No related branches found
No related tags found
No related merge requests found
......@@ -116,4 +116,4 @@ def update_status(token, message):
def send_message(user_id, user_name, user_info, subject, body):
email = user_id
name = user_name or user_info.get('name', email)
send_mail(subject, body, settings.SERVER_EMAIL, ["%s <%s>" % (name, email)], fail_silently=False)
send_mail(subject, body, settings.SERVER_EMAIL, ["\"%s\" <%s>" % (name, email)], fail_silently=False)
......@@ -117,4 +117,4 @@ class UserBlackboxTests(TestCase):
self.assertEquals(len(mail.outbox), 1)
self.assertEquals(mail.outbox[0].subject, "testing subject")
self.assertEquals(mail.outbox[0].to[0], "Foobar User <foobar-test@adida.net>")
self.assertEquals(mail.outbox[0].to[0], "\"Foobar User\" <foobar-test@adida.net>")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment