mirror of
https://github.com/django/django.git
synced 2025-04-09 07:56:43 +00:00
Update validators.py
Updated file to make Email Validator and Email Field max length as equal(254 characters as per RFC 5321).
This commit is contained in:
parent
10c7c7320b
commit
ec387f7c0d
@ -204,9 +204,9 @@ class EmailValidator:
|
||||
self.domain_allowlist = allowlist
|
||||
|
||||
def __call__(self, value):
|
||||
# The maximum length of an email is 320 characters per RFC 3696
|
||||
# The maximum length of an email is 254 characters per RFC 5321
|
||||
# section 3.
|
||||
if not value or "@" not in value or len(value) > 320:
|
||||
if not value or "@" not in value or len(value) > 254:
|
||||
raise ValidationError(self.message, code=self.code, params={"value": value})
|
||||
|
||||
user_part, domain_part = value.rsplit("@", 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user