Browse Source

Merge pull request #25 from denismakogon/consolidate

Consolidate path retrieving from route
Denis Makogon 2 years ago
parent
commit
bc5a57c133
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      picasso/api/controllers/runnable.py

+ 4
- 3
picasso/api/controllers/runnable.py View File

@@ -93,13 +93,14 @@ class PublicRunnableV1Controller(controller.ServiceController,
93 93
                 description: Unable to execute private route
94 94
         """
95 95
         app = request.match_info.get('app')
96
-        path = request.match_info.get('route')
97
-        routes = await app_model.Routes.find_by(app_name=app, path=path)
96
+        path = "/{}".format(request.match_info.get('route'))
97
+        routes = await app_model.Routes.find_by(
98
+            app_name=app, path=path)
98 99
 
99 100
         if not routes:
100 101
             return web.json_response(data={
101 102
                 "error": {
102
-                    "message": "Route {0} not found".format(app),
103
+                    "message": "Route {0} not found".format(path),
103 104
                 }
104 105
             }, status=404)
105 106
         route = routes.pop()

Loading…
Cancel
Save