datatracker/ietf/utils/fields.py
Emilio Jiménez 65afd10d4a Refactor mange group views:
* Create a new models NomComGroup with public_key field. Default type is nomcom
 * News urls and views to separate members and chair forms
 * Add rolodex url when person not found.
 * Views access is only for secretariat and chair roles
See #904
 - Legacy-Id: 5069
2012-11-22 10:46:39 +00:00

23 lines
641 B
Python

from django import forms
from django.forms.util import ValidationError
from django.core.validators import email_re
class MultiEmailField(forms.CharField):
widget = forms.widgets.Textarea
def clean(self, value):
super(MultiEmailField, self).clean(value)
if value:
if value.endswith(','):
value = value[:-1]
emails = map(unicode.strip, value.split(','))
else:
return value
for email in emails:
if not email_re.match(email):
raise ValidationError("This is not a valid comma separated email list.")
return value