Fixed an issue where parameters for roles were not visible. #5429

This commit is contained in:
Pravesh Sharma 2022-11-02 11:23:26 +05:30 committed by GitHub
parent 368d71b6ce
commit 16e28bb998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -831,6 +831,7 @@ rolmembership:{
) )
) )
variables = self.variables(None, None, rid)
if not status: if not status:
return internal_server_error( return internal_server_error(
_(ERROR_FETCHING_ROLE_INFORMATION + "\n{0}").format(res)) _(ERROR_FETCHING_ROLE_INFORMATION + "\n{0}").format(res))
@ -842,9 +843,9 @@ rolmembership:{
res['rows'][0]['is_sys_obj'] = ( res['rows'][0]['is_sys_obj'] = (
res['rows'][0]['oid'] <= self._DATABASE_LAST_SYSTEM_OID or res['rows'][0]['oid'] <= self._DATABASE_LAST_SYSTEM_OID or
self.datistemplate) self.datistemplate)
res = {**res['rows'][0], 'variables': variables['rows']}
return ajax_response( return ajax_response(
response=res['rows'][0], response=res,
status=200 status=200
) )
@ -1225,8 +1226,8 @@ rolmembership:{
return dependents return dependents
@check_precondition() # @check_precondition()
def variables(self, gid, sid, rid): def variables(self, gid, sid, rid, as_json=False):
status, rset = self.conn.execute_dict( status, rset = self.conn.execute_dict(
render_template(self.sql_path + 'variables.sql', render_template(self.sql_path + 'variables.sql',
@ -1240,7 +1241,8 @@ rolmembership:{
"Error retrieving variable information for the role.\n{0}" "Error retrieving variable information for the role.\n{0}"
).format(rset) ).format(rset)
) )
if not as_json:
return rset
return make_json_response( return make_json_response(
data=rset['rows'] data=rset['rows']
) )