summaryrefslogtreecommitdiff
path: root/src/mailman/rest/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-07-04 14:58:45 -0400
committerBarry Warsaw2015-07-18 23:21:05 -0400
commit759efff6eb63b3ba1fff15193923a3df72eb552c (patch)
tree97d61b867217476be4ef58de389644ee88d0ed13 /src/mailman/rest/helpers.py
parentfddfcbde937f61657bb29253609b63670beaae46 (diff)
downloadmailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.gz
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.tar.zst
mailman-759efff6eb63b3ba1fff15193923a3df72eb552c.zip
Diffstat (limited to 'src/mailman/rest/helpers.py')
-rw-r--r--src/mailman/rest/helpers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py
index c737fcbc7..84aa3663b 100644
--- a/src/mailman/rest/helpers.py
+++ b/src/mailman/rest/helpers.py
@@ -47,12 +47,13 @@ from pprint import pformat
-def path_to(resource):
+def path_to(resource, api_version):
"""Return the url path to a resource.
:param resource: The canonical path to the resource, relative to the
system base URI.
:type resource: string
+ :param api_version: API version to report.
:return: The full path to the resource.
:rtype: bytes
"""
@@ -60,7 +61,7 @@ def path_to(resource):
('https' if as_boolean(config.webservice.use_https) else 'http'),
config.webservice.hostname,
config.webservice.port,
- config.webservice.api_version,
+ api_version,
(resource[1:] if resource.startswith('/') else resource),
)
@@ -185,6 +186,9 @@ class CollectionMixin:
entries=entries,
)
+ def path_to(self, resource):
+ return path_to(resource, self.api_version)
+
class GetterSetter: