From 1fb852590c8b7b976d80974aad99fd1514ee4f73 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Tue, 19 Dec 2023 18:06:57 +0100 Subject: [PATCH] fix(chalice): fixed reset&update password at the same time (#1790) --- api/chalicelib/core/users.py | 2 ++ ee/api/chalicelib/core/users.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/api/chalicelib/core/users.py b/api/chalicelib/core/users.py index 929c3b763..caf6a9ade 100644 --- a/api/chalicelib/core/users.py +++ b/api/chalicelib/core/users.py @@ -127,6 +127,8 @@ def update(tenant_id, user_id, changes, output=True): sub_query_bauth.append("changed_at = timezone('utc'::text, now())") sub_query_bauth.append("change_pwd_expire_at = NULL") sub_query_bauth.append("change_pwd_token = NULL") + sub_query_bauth.append("invitation_token = NULL") + sub_query_bauth.append("invited_at = NULL") else: sub_query_bauth.append(f"{helper.key_to_snake_case(key)} = %({key})s") else: diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index 01a5c7744..ff307d472 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -152,6 +152,8 @@ def update(tenant_id, user_id, changes, output=True): sub_query_bauth.append("changed_at = timezone('utc'::text, now())") sub_query_bauth.append("change_pwd_expire_at = NULL") sub_query_bauth.append("change_pwd_token = NULL") + sub_query_bauth.append("invitation_token = NULL") + sub_query_bauth.append("invited_at = NULL") else: sub_query_bauth.append(f"{helper.key_to_snake_case(key)} = %({key})s") else: