109898688: Complete the implementation of the did not receive code.

This commit is contained in:
Rebecca Law
2015-12-17 14:25:03 +00:00
parent 64812c1614
commit 010be66d31
4 changed files with 67 additions and 27 deletions

View File

@@ -39,9 +39,13 @@ def use_code_for_user_and_type(user_id, code_type):
db.session.commit()
def get_code_by_id(id):
return VerifyCodes.query.get(id)
def add_code_with_expiry(user_id, code, code_type, expiry):
code = VerifyCodes(user_id=user_id,
code=code,
code=hashpw(code),
code_type=code_type,
expiry_datetime=expiry)