mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-28 17:24:47 -06:00
Validate table presence in SQL and Properties route handles. Fixes #2395
This commit is contained in:
parent
3bf17d9df4
commit
2ad14b379e
@ -1108,6 +1108,10 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
|
||||
status, res = self.conn.execute_dict(SQL)
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res)
|
||||
|
||||
if len(res['rows']) == 0:
|
||||
return gone(gettext("The specified table could not be found."))
|
||||
|
||||
data = res['rows'][0]
|
||||
|
||||
data['vacuum_settings_str'] = ""
|
||||
@ -1690,8 +1694,7 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res)
|
||||
data = res['rows'][0]
|
||||
# TODO://
|
||||
# Find SQL which can enable all or disable all triggers
|
||||
|
||||
SQL = render_template("/".join([self.template_path,
|
||||
'enable_disable_trigger.sql']),
|
||||
data=data, is_enable_trigger=is_enable)
|
||||
@ -2494,6 +2497,9 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res)
|
||||
|
||||
if len(res['rows']) == 0:
|
||||
return gone(gettext("The specified table could not be found."))
|
||||
|
||||
data = res['rows'][0]
|
||||
|
||||
# Table & Schema declaration so that we can use them in child nodes
|
||||
|
Loading…
Reference in New Issue
Block a user