mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
Update validators.py
Updated source policies
This commit is contained in:
parent
e9bc91d907
commit
737fbc0dc1
@ -204,7 +204,7 @@ class EmailValidator:
|
|||||||
self.domain_allowlist = allowlist
|
self.domain_allowlist = allowlist
|
||||||
|
|
||||||
def __call__(self, value):
|
def __call__(self, value):
|
||||||
# The maximum length of an email is 254 characters per RFC 5321
|
# The maximum length of an email is 254 characters per RFC 5321/5322
|
||||||
# section 3.
|
# section 3.
|
||||||
if not value or "@" not in value or len(value) > 254:
|
if not value or "@" not in value or len(value) > 254:
|
||||||
raise ValidationError(self.message, code=self.code, params={"value": value})
|
raise ValidationError(self.message, code=self.code, params={"value": value})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user