Merge pull request #25 from denismakogon/consolidate
Consolidate path retrieving from route
This commit is contained in:
commit
bc5a57c133
@ -93,13 +93,14 @@ class PublicRunnableV1Controller(controller.ServiceController,
|
|||||||
description: Unable to execute private route
|
description: Unable to execute private route
|
||||||
"""
|
"""
|
||||||
app = request.match_info.get('app')
|
app = request.match_info.get('app')
|
||||||
path = request.match_info.get('route')
|
path = "/{}".format(request.match_info.get('route'))
|
||||||
routes = await app_model.Routes.find_by(app_name=app, path=path)
|
routes = await app_model.Routes.find_by(
|
||||||
|
app_name=app, path=path)
|
||||||
|
|
||||||
if not routes:
|
if not routes:
|
||||||
return web.json_response(data={
|
return web.json_response(data={
|
||||||
"error": {
|
"error": {
|
||||||
"message": "Route {0} not found".format(app),
|
"message": "Route {0} not found".format(path),
|
||||||
}
|
}
|
||||||
}, status=404)
|
}, status=404)
|
||||||
route = routes.pop()
|
route = routes.pop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user