Permalink
Browse files

Allow dots in email part before ``@``

  • Loading branch information...
1 parent 96116d0 commit b6dae611f499faa9919f1737096fef1b298ceaea @kipanshi committed Nov 12, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 app.py
  2. +1 −0 tests.py
View
2 app.py
@@ -168,7 +168,7 @@ def teardown_request(exception):
# VALIDATION TOOLS
#============================
def is_valid_email(value):
- if re.match('^[a-zA-Z0-9_-]+@[a-z0-9_-]+\.[a-z]+$', value):
+ if re.match('^[\.a-zA-Z0-9_-]+@[a-z0-9_-]+\.[a-z]+$', value):
return True
View
@@ -14,6 +14,7 @@ def test_is_valid_email(self):
self.assertFalse(is_valid_email(u'Jack@foo'))
self.assertTrue(is_valid_email(u'Jack@foo.com'))
+ self.assertTrue(is_valid_email(u'Jack.Bird@foo.com'))
def test_is_valid_phone(self):
from app import is_valid_phone

0 comments on commit b6dae61

Please sign in to comment.