fix(chalice): fixed reset&update password at the same time (#1786)
This commit is contained in:
parent
aeea4e50aa
commit
77281ebd3e
2 changed files with 4 additions and 0 deletions
|
|
@ -125,6 +125,8 @@ def update(tenant_id, user_id, changes, output=True):
|
|||
if key == "password":
|
||||
sub_query_bauth.append("password = crypt(%(password)s, gen_salt('bf', 12))")
|
||||
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")
|
||||
else:
|
||||
sub_query_bauth.append(f"{helper.key_to_snake_case(key)} = %({key})s")
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ def update(tenant_id, user_id, changes, output=True):
|
|||
if key == "password":
|
||||
sub_query_bauth.append("password = crypt(%(password)s, gen_salt('bf', 12))")
|
||||
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")
|
||||
else:
|
||||
sub_query_bauth.append(f"{helper.key_to_snake_case(key)} = %({key})s")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue