Skip to content

Commit

Permalink
Merge pull request #56 from 00Kai0/fix-empty-email-error
Browse files Browse the repository at this point in the history
fix raise error when email is none
  • Loading branch information
leportella authored Feb 13, 2019
2 parents bad704a + bde5b8c commit 0312668
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nativeauthenticator/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def change_authorization(cls, db, username):

@validates('email')
def validate_email(self, key, address):
if not address:
return
assert re.match(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$",
address)
return address

0 comments on commit 0312668

Please sign in to comment.