Commit 067f11a2 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler Committed by Arkadiusz Hiler
Browse files

models.Person: Quote name in email_name() properly

If a person sends out emails with their name using 'Last, First'
notation, then when we compose email_name() it looks like:

'Last, First <address@email.tld>'

When test results are sent out, the above gets appended directly to the
recipient fields, resulting in emails being sent to 'Last@localhost' and
'First <address@email.tld>'.

Let's fix that by always putting the name in the quotes, just like that:

'"Last, First" <address@email.tld>'
Signed-off-by: default avatarArkadiusz Hiler <>
parent 1cb2039c
......@@ -56,7 +56,7 @@ class Person(models.Model):
def email_name(self):
if (
return "%s <%s>" % (,
return "\"%s\" <%s>" % (,
......@@ -57,3 +57,10 @@ class SubmitterCompletionTest(TestCase):
self.assertEqual(response.status_code, 200)
data = json.loads(response.content.decode())
self.assertEqual(len(data), 5)
class PersonModelTest(TestCase):
def testEmailNameQuoted(self):
p = Person(name="Name, Test", email="")
self.assertEqual(p.email_name(), '"Name, Test" <>')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment