Commits

Andriy Kornatskyy  committed 9a1bb40

Fixed email validation rule.

  • Participants
  • Parent commits 8a58b78

Comments (0)

Files changed (1)

File src/wheezy/validation/rules.py

         >>> result = []
         >>> r.validate('x.14@somewhere.org', None, None, result, _)
         True
+        >>> r.validate('x.14@somewhere.or g', None, None, result, _)
+        False
         >>> r.validate('x%', None, None, result, _)
         False
     """
 
     def __init__(self, message_template=None):
         super(EmailRule, self).__init__(
-            re.compile(r'[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,5}',
+            re.compile(r'^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,5}$',
                        re.IGNORECASE), False,
             message_template or
             _('Required to be a valid email address.'))