summaryrefslogtreecommitdiff
path: root/src/mailman/rest/wsgiapp.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-04-20 17:32:27 -0400
committerBarry Warsaw2012-04-20 17:32:27 -0400
commit847409ba333375bd9c168e28f15748e58970404f (patch)
tree1ca1044e3f2a90a0022a77910d1297bf52ff1159 /src/mailman/rest/wsgiapp.py
parentcd3f84b301c2150fea5402129a2e7bc862fbb52b (diff)
downloadmailman-847409ba333375bd9c168e28f15748e58970404f.tar.gz
mailman-847409ba333375bd9c168e28f15748e58970404f.tar.zst
mailman-847409ba333375bd9c168e28f15748e58970404f.zip
Diffstat (limited to 'src/mailman/rest/wsgiapp.py')
-rw-r--r--src/mailman/rest/wsgiapp.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mailman/rest/wsgiapp.py b/src/mailman/rest/wsgiapp.py
index 36e8ae5ac..a735d2012 100644
--- a/src/mailman/rest/wsgiapp.py
+++ b/src/mailman/rest/wsgiapp.py
@@ -33,6 +33,7 @@ from wsgiref.simple_server import WSGIRequestHandler
from wsgiref.simple_server import make_server as wsgi_server
from mailman.config import config
+from mailman.database.transaction import transactional
from mailman.rest.root import Root
@@ -51,17 +52,11 @@ class AdminWebServiceWSGIRequestHandler(WSGIRequestHandler):
class AdminWebServiceApplication(RestishApp):
"""Connect the restish WSGI application to Mailman's database."""
+ @transactional
def __call__(self, environ, start_response):
"""See `RestishApp`."""
- try:
- response = super(AdminWebServiceApplication, self).__call__(
- environ, start_response)
- except:
- config.db.abort()
- raise
- else:
- config.db.commit()
- return response
+ return super(AdminWebServiceApplication, self).__call__(
+ environ, start_response)