mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
109526036: Fix bug.
If one of the codes was invalid and one was valid on the verify page the valid code would be marked as used.
This commit is contained in:
@@ -31,6 +31,13 @@ def use_code(id):
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def use_code_for_user_and_type(user_id, code_type):
|
||||
verify_code = VerifyCodes.query.filter_by(user_id=user_id, code_type=code_type).first()
|
||||
verify_code.code_used = True
|
||||
db.session.add(verify_code)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def add_code_with_expiry(user_id, code, code_type, expiry):
|
||||
code = VerifyCodes(user_id=user_id,
|
||||
code=code,
|
||||
|
||||
Reference in New Issue
Block a user