From 5fd3a7dd3da1c108b12527ec29f4577c57b00eb2 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 20 Nov 2017 13:31:03 +0000 Subject: [PATCH] Display relevant error messages when access is denied creating a schema. Fixes #2094 --- .../server_groups/servers/databases/schemas/__init__.py | 3 +-- web/pgadmin/browser/static/js/node.js | 6 ++---- web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py index 04d243263..49c953c9d 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/__init__.py @@ -580,8 +580,7 @@ It may have been removed by another user. return make_json_response( status=410, success=0, - errormsg=res + '\n' + - 'Operation failed while running create statement' + errormsg=res ) # we need oid to to add object in tree at browser, diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js index 9a5b894b6..2beadf969 100644 --- a/web/pgadmin/browser/static/js/node.js +++ b/web/pgadmin/browser/static/js/node.js @@ -1153,10 +1153,8 @@ define( error: function(m, jqxhr) { Alertify.pgNotifier( "error", jqxhr, - S( - gettext("Error saving properties: %s") - ).sprintf(jqxhr.statusText).value() - ); + gettext("Error saving properties") + ); // Hide progress cursor $('.obj_properties').removeClass('show_progress'); diff --git a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js index 61b0edab5..4898f7fe9 100644 --- a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js +++ b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js @@ -1089,10 +1089,8 @@ define([ error: function(m, jqxhr) { alertify.pgNotifier( "error", jqxhr, - S( - gettext("Error saving properties: %s") - ).sprintf(jqxhr.statusText).value() - ); + gettext("Error saving properties") + ); // Release wizard objects self.releaseObjects();