summaryrefslogtreecommitdiff
path: root/ick2
diff options
context:
space:
mode:
Diffstat (limited to 'ick2')
-rw-r--r--ick2/apibase.py7
-rw-r--r--ick2/projectapi.py4
2 files changed, 5 insertions, 6 deletions
diff --git a/ick2/apibase.py b/ick2/apibase.py
index 9e3eaff..b629f68 100644
--- a/ick2/apibase.py
+++ b/ick2/apibase.py
@@ -23,6 +23,7 @@ class APIbase:
self._trans = ick2.TransactionalState(state)
def get_routes(self, path):
+ resource_path = '{}/<name:re:[^/+][^/]*?(/[^/+][^/]*?)*>'.format(path)
return [
{
'method': 'POST',
@@ -36,17 +37,17 @@ class APIbase:
},
{
'method': 'GET',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.GET(self.show),
},
{
'method': 'PUT',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.PUT(self.update),
},
{
'method': 'DELETE',
- 'path': '{}/<name>'.format(path),
+ 'path': resource_path,
'callback': self.DELETE(self.delete),
},
]
diff --git a/ick2/projectapi.py b/ick2/projectapi.py
index f351e8d..90197ae 100644
--- a/ick2/projectapi.py
+++ b/ick2/projectapi.py
@@ -39,9 +39,7 @@ class ProjectAPI(ick2.ResourceApiBase):
return super().get_routes(path) + self.get_status_routes(path)
def get_status_routes(self, path): # pragma: no cover
- all_statuses_path = '/status'
- status_path = '{}/<project>/status'.format(path)
- trigger_path = '{}/<project>/+trigger'.format(path)
+ trigger_path = '{}/<project:path>/+trigger'.format(path)
return [
{
'needs-authorization': False,