Get rid of remaining use of email_re, use validate_email instead
- Legacy-Id: 6882
This commit is contained in:
parent
119d76ae26
commit
2c930d0f97
|
@ -5,7 +5,7 @@ from django import forms
|
|||
from django.conf import settings
|
||||
from django.db.models import Q
|
||||
from django.forms.util import ErrorList
|
||||
from django.core.validators import email_re
|
||||
from django.core.validators import validate_email, ValidationError
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
from ietf.liaisons.accounts import (can_add_outgoing_liaison, can_add_incoming_liaison,
|
||||
|
@ -150,7 +150,9 @@ class LiaisonForm(forms.Form):
|
|||
emails = value.split(',')
|
||||
for email in emails:
|
||||
name, addr = parseaddr(email)
|
||||
if not email_re.search(addr):
|
||||
try:
|
||||
validate_email(addr)
|
||||
except ValidationError:
|
||||
raise forms.ValidationError('Invalid email address: %s' % addr)
|
||||
|
||||
def clean_response_contact(self):
|
||||
|
|
|
@ -16,7 +16,6 @@ from django.core.urlresolvers import reverse
|
|||
from django.template.loader import render_to_string
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.utils.encoding import smart_str
|
||||
from django.core.validators import email_re
|
||||
|
||||
from ietf.dbtemplate.models import DBTemplate
|
||||
from ietf.person.models import Email, Person
|
||||
|
|
Loading…
Reference in a new issue