Use validate_email instead of email_re to validate email
- Legacy-Id: 6893
This commit is contained in:
parent
d1207bf000
commit
fdd03eee8c
|
@ -1,7 +1,7 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.validators import email_re
|
||||
from django.core.validators import validate_email
|
||||
|
||||
from ietf.person.models import Email, Person
|
||||
|
||||
|
@ -83,8 +83,8 @@ class NewEmailForm(EmailForm):
|
|||
cleaned_data = self.cleaned_data
|
||||
address = cleaned_data.get("address")
|
||||
|
||||
if address and not email_re.match(address):
|
||||
raise forms.ValidationError("Enter a valid email address")
|
||||
if address:
|
||||
validate_email(address)
|
||||
|
||||
return address
|
||||
|
||||
|
|
Loading…
Reference in a new issue