mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Fix the issue where the update-user CLI command doesn't change the password. #7304
This commit is contained in:
parent
b742487dc3
commit
48a86f6c38
12
web/setup.py
12
web/setup.py
@ -47,7 +47,8 @@ from typing import Optional, List
|
||||
from typing_extensions import Annotated
|
||||
from pgadmin.utils.constants import INTERNAL, LDAP, OAUTH2, \
|
||||
KERBEROS, WEBSERVER
|
||||
from pgadmin.tools.user_management import create_user, delete_user, update_user
|
||||
from pgadmin.tools.user_management import create_user, delete_user, \
|
||||
update_user as user_management_update_user
|
||||
from enum import Enum
|
||||
from flask_babel import gettext
|
||||
|
||||
@ -244,7 +245,10 @@ class ManageUsers:
|
||||
if len(password) < 6:
|
||||
print("Password must be at least 6 characters long.")
|
||||
exit()
|
||||
data['password'] = password
|
||||
# validate_password relies on the new password being present as
|
||||
# `newPassword` and `confirmPassword` in the data
|
||||
data['newPassword'] = password
|
||||
data['confirmPassword'] = password
|
||||
|
||||
if role is not None:
|
||||
data['role'] = 1 if role else 2
|
||||
@ -258,7 +262,7 @@ class ManageUsers:
|
||||
if not uid:
|
||||
print("User not found")
|
||||
else:
|
||||
status, msg = update_user(uid, data)
|
||||
status, msg = user_management_update_user(uid, data)
|
||||
if status:
|
||||
_user = ManageUsers.get_users_from_db(username=email,
|
||||
auth_source=INTERNAL,
|
||||
@ -344,7 +348,7 @@ class ManageUsers:
|
||||
if not uid:
|
||||
print("User not found")
|
||||
else:
|
||||
status, msg = update_user(uid, data)
|
||||
status, msg = user_management_update_user(uid, data)
|
||||
if status:
|
||||
_user = ManageUsers.get_users_from_db(
|
||||
username=username,
|
||||
|
Loading…
Reference in New Issue
Block a user