Don't rollback if exception is HTTPSuccessful or HTTPRedirection
In the request finishing, the 'cleanup' callback set by _cw_cnx
automatically commit the transaction except is an exception is set
on the request.
Problem is, redirections and successul http return code can raise
exceptions.
This patch detects such exceptions and avoid rolling back the transaction.
Closes #4566482
from pyramid.config import Configurator
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_cubicweb.init_instance')
config.include('pyramid_cubicweb.defaults')
config.include('pyramid_cubicweb.core')
config.include('pyramid_cubicweb.bwcompat')
# config.add_static_view('static', 'static', cache_max_age=3600)
# config.add_route('home', '/')
# config.scan()
return config.make_wsgi_app()