~barry/mailman/events-and-web

« back to all changes in this revision

Viewing changes to src/mailman/rest/wsgiapp.py

  • Committer: Barry Warsaw
  • Date: 2012-04-21 22:09:39 UTC
  • mfrom: (7149.1.1 3.0)
  • Revision ID: barry@list.org-20120421220939-p0czqg7eiron15it
Rename mailman.database.transaction.txn to ...transactional.  Modernize the
module, and use it in another convenient place.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from wsgiref.simple_server import make_server as wsgi_server
34
34
 
35
35
from mailman.config import config
 
36
from mailman.database.transaction import transactional
36
37
from mailman.rest.root import Root
37
38
 
38
39
 
51
52
class AdminWebServiceApplication(RestishApp):
52
53
    """Connect the restish WSGI application to Mailman's database."""
53
54
 
 
55
    @transactional
54
56
    def __call__(self, environ, start_response):
55
57
        """See `RestishApp`."""
56
 
        try:
57
 
            response = super(AdminWebServiceApplication, self).__call__(
58
 
                environ, start_response)
59
 
        except:
60
 
            config.db.abort()
61
 
            raise
62
 
        else:
63
 
            config.db.commit()
64
 
            return response
 
58
        return super(AdminWebServiceApplication, self).__call__(
 
59
            environ, start_response)
65
60
 
66
61
 
67
62