summaryrefslogtreecommitdiff
path: root/src/mailman/rest/wsgiapp.py
diff options
context:
space:
mode:
authorBarry Warsaw2016-01-13 00:14:08 -0500
committerBarry Warsaw2016-01-13 00:17:49 -0500
commitd75a7ebb46279f341b498bf517d07e9ae4c27f0a (patch)
treebaaea8a2dc102887b057f9da5184bbe61ba22aef /src/mailman/rest/wsgiapp.py
parent03bb57c8c2a47a08e19b20975622ebb2ef2b81c6 (diff)
downloadmailman-d75a7ebb46279f341b498bf517d07e9ae4c27f0a.tar.gz
mailman-d75a7ebb46279f341b498bf517d07e9ae4c27f0a.tar.zst
mailman-d75a7ebb46279f341b498bf517d07e9ae4c27f0a.zip
Refactor API contexts.
Rather than sprinkle API version string tests all over the place, create an IAPI interface which encapsulates the differences between API 3.0 and 3.1, and arrange for this to be used to convert to and from UUIDs.
Diffstat (limited to 'src/mailman/rest/wsgiapp.py')
-rw-r--r--src/mailman/rest/wsgiapp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mailman/rest/wsgiapp.py b/src/mailman/rest/wsgiapp.py
index 9bac53c71..3155ee510 100644
--- a/src/mailman/rest/wsgiapp.py
+++ b/src/mailman/rest/wsgiapp.py
@@ -76,7 +76,7 @@ class AdminWebServiceWSGIRequestHandler(WSGIRequestHandler):
class SetAPIVersion:
- """Falcon middleware object that sets the api_version on resources."""
+ """Falcon middleware object that sets the API on resources."""
def process_resource(self, request, response, resource):
# Set this attribute on the resource right before it is dispatched
@@ -88,7 +88,7 @@ class SetAPIVersion:
# resource path does not exist. This middleware method will still get
# called, but there's nothing to set the api_version on.
if resource is not None:
- resource.api_version = request.context.get('api_version')
+ resource.api = request.context.get('api')
class RootedAPI(API):