Commit 2e336f3b authored by Aurel's avatar Aurel

wip : test not patching WSGIPublisher as it is a backport from Zope4

parent 1da6c053
...@@ -15,7 +15,7 @@ import ZConfig ...@@ -15,7 +15,7 @@ import ZConfig
import Zope2 import Zope2
from Zope2.Startup.run import make_wsgi_app from Zope2.Startup.run import make_wsgi_app
from Products.ERP5Type.patches.WSGIPublisher import publish_module from ZPublisher.WSGIPublisher import publish_module
# this class licensed under the MIT license (stolen from pyramid_translogger) # this class licensed under the MIT license (stolen from pyramid_translogger)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
############################################################################## ##############################################################################
# Load all monkey patches # Load all monkey patches
from Products.ERP5Type.patches import WSGIPublisher #from Products.ERP5Type.patches import WSGIPublisher
from Products.ERP5Type.patches import HTTPRequest from Products.ERP5Type.patches import HTTPRequest
from Products.ERP5Type.patches import AccessControl_patch from Products.ERP5Type.patches import AccessControl_patch
from Products.ERP5Type.patches import Restricted from Products.ERP5Type.patches import Restricted
......
...@@ -388,7 +388,7 @@ def load_app(module_info): ...@@ -388,7 +388,7 @@ def load_app(module_info):
try: try:
yield (app, realm, debug_mode, validated_hook) yield (app, realm, debug_mode, validated_hook)
finally: finally:
if transaction.manager._txn is not None: if getattr(transaction.manager, '_txn', None) is not None:
# Only abort a transaction, if one exists. Otherwise the # Only abort a transaction, if one exists. Otherwise the
# abort creates a new transaction just to abort it. # abort creates a new transaction just to abort it.
transaction.abort() transaction.abort()
...@@ -470,4 +470,4 @@ def publish_module(environ, start_response, ...@@ -470,4 +470,4 @@ def publish_module(environ, start_response,
return result return result
sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__] #sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment