From 3b1ebec9c030f18ad424afa252c2ed98e985aad3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 20 Aug 2024 15:20:11 -0500 Subject: Fix query: Replace any existing token. --- gn_auth/auth/authorisation/users/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gn_auth') diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py index 84d7ef0..3083724 100644 --- a/gn_auth/auth/authorisation/users/views.py +++ b/gn_auth/auth/authorisation/users/views.py @@ -385,10 +385,9 @@ def send_forgot_password_email(conn, user: User): with db.cursor(conn) as cursor: cursor.execute( - ("INSERT INTO " + ("INSERT OR REPLACE INTO " "forgot_password_tokens(user_id, token, generated, expires) " - "VALUES (:user_id, :token, :generated, :expires) " - "ON CONFLICT (user_id) REPLACE"), + "VALUES (:user_id, :token, :generated, :expires)"), { "user_id": str(user.user_id), "token": token, -- cgit v1.2.3