mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-20 11:48:31 -06:00
Flask 1.0.2 does not allow a dot (.) in the view_func name, which we use
during generting the routes for the node.
References:
2f57a0b917
https://github.com/pallets/flask/issues/2790
Fixes #3360
Reported by: Marcelo Mendes
Investigated by: Khushboo Vashi
This commit is contained in:
parent
5f51c39e6f
commit
f2cef38364
@ -266,6 +266,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||
commands = cls.generate_ops()
|
||||
|
||||
for c in commands:
|
||||
cmd = c['cmd'].replace('.', '-')
|
||||
if c['with_id']:
|
||||
blueprint.add_url_rule(
|
||||
'/{0}{1}'.format(
|
||||
@ -273,7 +274,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||
),
|
||||
view_func=cls.as_view(
|
||||
'{0}{1}'.format(
|
||||
c['cmd'], '_id' if c['req'] else ''
|
||||
cmd, '_id' if c['req'] else ''
|
||||
),
|
||||
cmd=c['cmd']
|
||||
),
|
||||
@ -283,7 +284,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||
blueprint.add_url_rule(
|
||||
'/{0}'.format(c['cmd']),
|
||||
view_func=cls.as_view(
|
||||
'{0}'.format(c['cmd']), cmd=c['cmd']
|
||||
cmd, cmd=c['cmd']
|
||||
),
|
||||
methods=c['methods']
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user