mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed validation of email addresses when the local part contains an @.
See also BaseUserManager.normalize_email -- it uses rsplit. Refs #4833.
This commit is contained in:
@@ -106,7 +106,7 @@ class EmailValidator(object):
|
||||
if not value or '@' not in value:
|
||||
raise ValidationError(self.message, code=self.code)
|
||||
|
||||
user_part, domain_part = value.split('@', 1)
|
||||
user_part, domain_part = value.rsplit('@', 1)
|
||||
|
||||
if not self.user_regex.match(user_part):
|
||||
raise ValidationError(self.message, code=self.code)
|
||||
|
||||
Reference in New Issue
Block a user