From 16e28bb99829c4f9c939b98eed48987dbd7d3b88 Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Wed, 2 Nov 2022 11:23:26 +0530 Subject: [PATCH] Fixed an issue where parameters for roles were not visible. #5429 --- .../browser/server_groups/servers/roles/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/roles/__init__.py b/web/pgadmin/browser/server_groups/servers/roles/__init__.py index 13b81b540..f84bf8602 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/roles/__init__.py @@ -831,6 +831,7 @@ rolmembership:{ ) ) + variables = self.variables(None, None, rid) if not status: return internal_server_error( _(ERROR_FETCHING_ROLE_INFORMATION + "\n{0}").format(res)) @@ -842,9 +843,9 @@ rolmembership:{ res['rows'][0]['is_sys_obj'] = ( res['rows'][0]['oid'] <= self._DATABASE_LAST_SYSTEM_OID or self.datistemplate) - + res = {**res['rows'][0], 'variables': variables['rows']} return ajax_response( - response=res['rows'][0], + response=res, status=200 ) @@ -1225,8 +1226,8 @@ rolmembership:{ return dependents - @check_precondition() - def variables(self, gid, sid, rid): + # @check_precondition() + def variables(self, gid, sid, rid, as_json=False): status, rset = self.conn.execute_dict( render_template(self.sql_path + 'variables.sql', @@ -1240,7 +1241,8 @@ rolmembership:{ "Error retrieving variable information for the role.\n{0}" ).format(rset) ) - + if not as_json: + return rset return make_json_response( data=rset['rows'] )