Skip to content

Commit 471cd05

Browse files
committed
Fixed a problem with the spiffy ajax handling of email fields when test cases submit a textual list of email addresses instead of a python list.
- Legacy-Id: 4937
1 parent 1f8cc48 commit 471cd05

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ietf/person/forms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44
from django import forms
55
from django.core.urlresolvers import reverse as urlreverse
66

7+
import debug
8+
79
from ietf.person.models import *
810

911
def json_emails(emails):
12+
if isinstance(emails, basestring):
13+
emails = Email.objects.filter(address__in=[x.strip() for x in emails.split(",") if x.strip()]).select_related("person")
1014
return simplejson.dumps([{"id": e.address + "", "name": escape(u"%s <%s>" % (e.person.name, e.address))} for e in emails])
1115

1216
class EmailsField(forms.CharField):

0 commit comments

Comments
 (0)