Only actually call api to verify code if both are present in form.

This commit is contained in:
Adam Shimali
2016-03-10 14:48:33 +00:00
parent 8c250a7853
commit 54f871dfba
3 changed files with 30 additions and 8 deletions

View File

@@ -24,6 +24,7 @@ def verify():
def _check_code(code, code_type):
return users_dao.check_verify_code(user_id, code, code_type)
form = VerifyForm(_check_code)
if form.validate_on_submit():
try:
@@ -37,6 +38,6 @@ def verify():
else:
raise e
finally:
del session['user_details']
session.pop('user_details', None)
return render_template('views/verify.html', form=form)