* 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
23 lines
641 B
Python
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
|