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
pull/14/head
parent
5f51c39e6f
commit
f2cef38364
|
@ -266,6 +266,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||||
commands = cls.generate_ops()
|
commands = cls.generate_ops()
|
||||||
|
|
||||||
for c in commands:
|
for c in commands:
|
||||||
|
cmd = c['cmd'].replace('.', '-')
|
||||||
if c['with_id']:
|
if c['with_id']:
|
||||||
blueprint.add_url_rule(
|
blueprint.add_url_rule(
|
||||||
'/{0}{1}'.format(
|
'/{0}{1}'.format(
|
||||||
|
@ -273,7 +274,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||||
),
|
),
|
||||||
view_func=cls.as_view(
|
view_func=cls.as_view(
|
||||||
'{0}{1}'.format(
|
'{0}{1}'.format(
|
||||||
c['cmd'], '_id' if c['req'] else ''
|
cmd, '_id' if c['req'] else ''
|
||||||
),
|
),
|
||||||
cmd=c['cmd']
|
cmd=c['cmd']
|
||||||
),
|
),
|
||||||
|
@ -283,7 +284,7 @@ class NodeView(with_metaclass(MethodViewType, View)):
|
||||||
blueprint.add_url_rule(
|
blueprint.add_url_rule(
|
||||||
'/{0}'.format(c['cmd']),
|
'/{0}'.format(c['cmd']),
|
||||||
view_func=cls.as_view(
|
view_func=cls.as_view(
|
||||||
'{0}'.format(c['cmd']), cmd=c['cmd']
|
cmd, cmd=c['cmd']
|
||||||
),
|
),
|
||||||
methods=c['methods']
|
methods=c['methods']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue