mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-23 01:06:31 -06:00
Fixes #1213 - Dropping the materialized view using an non-super user
results into an error - "list index out of range". Using correct variable name while accessing parameter from an dictionary.
This commit is contained in:
parent
d4644428e6
commit
c0ab396fad
@ -564,20 +564,26 @@ class ViewNode(PGChildNodeView, VacuumSettings):
|
||||
cascade = True if self.cmd == 'delete' else False
|
||||
|
||||
try:
|
||||
|
||||
# Get name for view from did
|
||||
SQL = render_template("/".join(
|
||||
[self.template_path, 'sql/delete.sql']), vid=vid)
|
||||
# Get name for view from vid
|
||||
SQL = render_template(
|
||||
"/".join([
|
||||
self.template_path, 'sql/properties.sql'
|
||||
]),
|
||||
vid=vid,
|
||||
datlastsysoid=self.datlastsysoid
|
||||
)
|
||||
status, res_data = self.conn.execute_dict(SQL)
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res_data)
|
||||
|
||||
# drop view
|
||||
SQL = render_template("/".join(
|
||||
[self.template_path, 'sql/delete.sql']),
|
||||
nspname=res_data['rows'][0]['nspname'],
|
||||
SQL = render_template(
|
||||
"/".join([
|
||||
self.template_path, 'sql/delete.sql'
|
||||
]),
|
||||
nspname=res_data['rows'][0]['schema'],
|
||||
name=res_data['rows'][0]['name'], cascade=cascade
|
||||
)
|
||||
)
|
||||
status, res = self.conn.execute_scalar(SQL)
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res)
|
||||
|
Loading…
Reference in New Issue
Block a user