mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
[COLLATIONS] Do not assign the paramter values, use separate variable for new value
This commit is contained in:
@@ -448,6 +448,7 @@ class CollationView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
)
|
)
|
||||||
|
|
||||||
required_args = [
|
required_args = [
|
||||||
|
'schema',
|
||||||
'name'
|
'name'
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -470,31 +471,35 @@ class CollationView(PGChildNodeView, SchemaDiffObjectCompare):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
SQL = render_template("/".join([self.template_path,
|
SQL = render_template(
|
||||||
'create.sql']),
|
"/".join([self.template_path, 'create.sql']),
|
||||||
data=data, conn=self.conn)
|
data=data, conn=self.conn
|
||||||
|
)
|
||||||
status, res = self.conn.execute_scalar(SQL)
|
status, res = self.conn.execute_scalar(SQL)
|
||||||
if not status:
|
if not status:
|
||||||
return internal_server_error(errormsg=res)
|
return internal_server_error(errormsg=res)
|
||||||
|
|
||||||
# We need oid to to add object in tree at browser
|
# We need oid to to add object in tree at browser
|
||||||
SQL = render_template("/".join([self.template_path,
|
SQL = render_template(
|
||||||
'get_oid.sql']), data=data)
|
"/".join([self.template_path, 'get_oid.sql']), data=data
|
||||||
|
)
|
||||||
status, coid = self.conn.execute_scalar(SQL)
|
status, coid = self.conn.execute_scalar(SQL)
|
||||||
if not status:
|
if not status:
|
||||||
return internal_server_error(errormsg=coid)
|
return internal_server_error(errormsg=coid)
|
||||||
|
|
||||||
# Get updated schema oid
|
# Get updated schema oid
|
||||||
SQL = render_template("/".join([self.template_path,
|
SQL = render_template(
|
||||||
'get_oid.sql']), coid=coid)
|
"/".join([self.template_path, 'get_oid.sql']), coid=coid
|
||||||
status, scid = self.conn.execute_scalar(SQL)
|
)
|
||||||
|
|
||||||
|
status, new_scid = self.conn.execute_scalar(SQL)
|
||||||
if not status:
|
if not status:
|
||||||
return internal_server_error(errormsg=coid)
|
return internal_server_error(errormsg=coid)
|
||||||
|
|
||||||
return jsonify(
|
return jsonify(
|
||||||
node=self.blueprint.generate_browser_node(
|
node=self.blueprint.generate_browser_node(
|
||||||
coid,
|
coid,
|
||||||
scid,
|
new_scid,
|
||||||
data['name'],
|
data['name'],
|
||||||
icon="icon-collation"
|
icon="icon-collation"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user