paj  committed 9149326

Move repoze_tm from make_middleware to dev_server

  • Participants
  • Parent commits c4a5143

Comments (0)

Files changed (1)

File tw2/devtools/

 def dev_server(
     app=None, host='', 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 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)