summaryrefslogtreecommitdiff
path: root/src/mailman/rest/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/rest/urls.py')
-rw-r--r--src/mailman/rest/urls.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mailman/rest/urls.py b/src/mailman/rest/urls.py
index a0f1b396a..384c21dba 100644
--- a/src/mailman/rest/urls.py
+++ b/src/mailman/rest/urls.py
@@ -45,6 +45,7 @@ class AbsoluteURLMapper:
"""Initialize with respect to a context and request."""
self.context = context
self.request = request
+ # XXX Is this strictly necessary?
self.webservice_config = AdminWebServiceConfiguration()
self.version = self.webservice_config.service_version_uri_prefix
self.schema = ('https' if self.webservice_config.use_https else 'http')
@@ -53,13 +54,14 @@ class AbsoluteURLMapper:
def __str__(self):
"""Return the semi-hard-coded URL to the service root."""
- path = self[self.context]
+ path = self._lookup(self.context)
return '{0.schema}://{0.hostname}:{0.port}/{0.version}/{1}'.format(
self, path)
+ # XXX Is this strictly necessary?
__call__ = __str__
- def __getitem__(self, ob):
+ def _lookup(self, ob):
"""Return the path component for the object.
:param ob: The object we're looking for.