1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-22 07:17:05 +00:00

conn.close() if mru_token update can't .commit()

This commit is contained in:
Felix Spöttel 2020-09-03 20:39:03 +02:00
parent 08ae3d2b7f
commit b0df35eba0

View File

@ -576,7 +576,9 @@ def set_mru_totp_code(email, token, env):
c.execute('UPDATE totp_credentials SET mru_token=? WHERE user_email=?', (token, email))
if c.rowcount != 1:
conn.close()
raise ValueError("That's not a user (%s)." % email)
conn.commit()
return "OK"