From 6e42d9113b8d3a8fbbeac8bdc4a0ac1d7ff59b19 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Thu, 10 Jun 2021 22:56:38 +0530 Subject: [PATCH] Fixed user password-related issues. refs #6225 --- web/migrations/versions/c465fee44968_.py | 2 +- web/pgadmin/browser/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/migrations/versions/c465fee44968_.py b/web/migrations/versions/c465fee44968_.py index 07459675d..ac47b5bcd 100644 --- a/web/migrations/versions/c465fee44968_.py +++ b/web/migrations/versions/c465fee44968_.py @@ -32,7 +32,7 @@ def upgrade(): auth_source VARCHAR(256) NOT NULL DEFAULT 'internal', fs_uniquifier NOT NULL UNIQUE, PRIMARY KEY (id), - UNIQUE (username, auth_source, fs_uniquifier), + UNIQUE (username, auth_source), CHECK (active IN (0, 1)) ); """) diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py index e91a72a57..6e9fb6298 100644 --- a/web/pgadmin/browser/__init__.py +++ b/web/pgadmin/browser/__init__.py @@ -1134,7 +1134,8 @@ if hasattr(config, 'SECURITY_CHANGEABLE') and config.SECURITY_CHANGEABLE: if form.validate_on_submit(): try: - change_user_password(current_user, form.new_password.data) + change_user_password(current_user._get_current_object(), + form.new_password.data) except SOCKETErrorException as e: # Handle socket errors which are not covered by SMTPExceptions. logging.exception(str(e), exc_info=True)