From 1141aeb52434675eddf1f42a5da4abb2118a18e4 Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Mon, 7 Feb 2022 11:51:27 +0530 Subject: [PATCH] 1) Fixes the incorrect title shown for the error message in restore/backup. 2) Doc updates for webserver authentication. 3) Cleanup task for API tests. --- docs/en_US/webserver.rst | 5 +++-- .../servers/roles/tests/test_role_reassign_own.py | 12 ++++++------ web/pgadmin/tools/backup/static/js/backup.js | 2 +- .../tools/import_export/static/js/import_export.js | 2 +- .../tools/maintenance/static/js/maintenance.js | 2 +- web/pgadmin/tools/restore/static/js/restore.js | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/en_US/webserver.rst b/docs/en_US/webserver.rst index c54c14164..2de1d6630 100644 --- a/docs/en_US/webserver.rst +++ b/docs/en_US/webserver.rst @@ -32,8 +32,9 @@ and modify the values for the following parameters: "WEBSERVER_AUTO_CREATE_USER", "Set the value to *True* if you want to automatically create a pgAdmin user corresponding to a successfully authenticated Webserver user. Please note that password is not stored in the pgAdmin database." - "WEBSERVER_REMOTE_USER", "The default value is REMOTE_USER, set this variable to any header - or environemnt variable to get the webserver remote user details. Possible values: REMOTE_USER, + "WEBSERVER_REMOTE_USER", "To get the web server remote user details, set this variable to any header or + environment variable name which comes from the web server after webserver authentication. + The default value is REMOTE_USER and the possible values are REMOTE_USER, HTTP_X_FORWARDED_USER, X-Forwarded-User." diff --git a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_reassign_own.py b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_reassign_own.py index 9519ed5ad..c7b84a53c 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_reassign_own.py +++ b/web/pgadmin/browser/server_groups/servers/roles/tests/test_role_reassign_own.py @@ -32,6 +32,12 @@ class ReassignRoleTestCase(BaseTestGenerator): self.data = self.test_data + if self.data["role_op"] == 'reassign' and \ + hasattr(self, 'server_min_version') and \ + self.server_information['server_version'] \ + < self.server_min_version: + self.skipTest(self.skip_msg) + self.role_name = "role_get_%s" % str(uuid.uuid4())[1:8] self.role_id = roles_utils.create_role(self.server, self.role_name) @@ -45,12 +51,6 @@ class ReassignRoleTestCase(BaseTestGenerator): self.data['did'] = parent_node_dict['database'][-1]['db_id'] if self.data["role_op"] == 'reassign': - - if hasattr(self, 'server_min_version') and \ - self.server_information['server_version'] \ - < self.server_min_version: - self.skipTest(self.skip_msg) - self.role_name_1 = "role_get_%s" % str(uuid.uuid4())[1:8] self.role_id_1 = roles_utils.create_role(self.server, self.role_name_1) diff --git a/web/pgadmin/tools/backup/static/js/backup.js b/web/pgadmin/tools/backup/static/js/backup.js index 7f9d28b74..3a73fbb78 100644 --- a/web/pgadmin/tools/backup/static/js/backup.js +++ b/web/pgadmin/tools/backup/static/js/backup.js @@ -177,7 +177,7 @@ define([ saveCallBack: function(data, dialog) { if(data.errormsg) { Notify.alert( - gettext('Utility not found'), + gettext('Error'), gettext(data.errormsg) ); } else { diff --git a/web/pgadmin/tools/import_export/static/js/import_export.js b/web/pgadmin/tools/import_export/static/js/import_export.js index f9f6045cb..6dc79e5aa 100644 --- a/web/pgadmin/tools/import_export/static/js/import_export.js +++ b/web/pgadmin/tools/import_export/static/js/import_export.js @@ -79,7 +79,7 @@ define([ importExportCallBack: function(data, dialog) { if(data.errormsg) { Notify.alert( - gettext('Utility not found'), + gettext('Error'), gettext(data.errormsg) ); } else { diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.js b/web/pgadmin/tools/maintenance/static/js/maintenance.js index 9209e51d0..4fcda6b33 100644 --- a/web/pgadmin/tools/maintenance/static/js/maintenance.js +++ b/web/pgadmin/tools/maintenance/static/js/maintenance.js @@ -88,7 +88,7 @@ define([ saveCallBack: function(data, dialog) { if(data.errormsg) { Notify.alert( - gettext('Utility not found'), + gettext('Error'), gettext(data.errormsg) ); } else { diff --git a/web/pgadmin/tools/restore/static/js/restore.js b/web/pgadmin/tools/restore/static/js/restore.js index 24cf07844..2504469e3 100644 --- a/web/pgadmin/tools/restore/static/js/restore.js +++ b/web/pgadmin/tools/restore/static/js/restore.js @@ -93,7 +93,7 @@ define('tools.restore', [ saveCallBack: function(data, dialog) { if(data.errormsg) { Notify.alert( - gettext('Utility not found'), + gettext('Error'), gettext(data.errormsg) ); } else {