summaryrefslogtreecommitdiff
path: root/src/mailman/rest/helpers.py
diff options
context:
space:
mode:
authorBarry Warsaw2015-07-19 15:40:07 +0000
committerBarry Warsaw2015-07-19 15:40:07 +0000
commitd903aa4ba57dc19699972bf22b7874edd90434a8 (patch)
tree32fa44f854cf762b156c93ecba1a63be43e454c5 /src/mailman/rest/helpers.py
parentfddfcbde937f61657bb29253609b63670beaae46 (diff)
parent5a08c47353cefccaa021e0f488ab76f3806dd49c (diff)
downloadmailman-d903aa4ba57dc19699972bf22b7874edd90434a8.tar.gz
mailman-d903aa4ba57dc19699972bf22b7874edd90434a8.tar.zst
mailman-d903aa4ba57dc19699972bf22b7874edd90434a8.zip
Diffstat (limited to 'src/mailman/rest/helpers.py')
-rw-r--r--src/mailman/rest/helpers.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mailman/rest/helpers.py b/src/mailman/rest/helpers.py
index c737fcbc7..0bba86521 100644
--- a/src/mailman/rest/helpers.py
+++ b/src/mailman/rest/helpers.py
@@ -47,12 +47,14 @@ 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.
+ :type api_version: string
:return: The full path to the resource.
:rtype: bytes
"""
@@ -60,7 +62,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 +187,9 @@ class CollectionMixin:
entries=entries,
)
+ def path_to(self, resource):
+ return path_to(resource, self.api_version)
+
class GetterSetter: