Commits

Anonymous committed 9149326

Move repoze_tm from make_middleware to dev_server

Comments (0)

Files changed (1)

tw2/devtools/server.py

 def dev_server(
     app=None, host='127.0.0.1', port=8000, logging=True, weberror=True,
     use_threadpool=None, threadpool_workers=10, request_queue_size=5,
-    **config):
+    repoze_tm=False, **config):
     """
     Run a development server, hosting the ToscaWidgets application.
     This requires Paste and WebError, which are only sure to be available if
     config.setdefault('controller_prefix', '/')
     app = twc.make_middleware(app, **config)
 
+    if repoze_tm:
+        import repoze.tm as rtm, tw2.sqla as tws
+        app = rtm.TM(app, tws.commit_veto)
+
     if weberror:
         import weberror.errormiddleware as we
         app = we.ErrorMiddleware(app, debug=True)