# HG changeset patch # User Denis Laxalde # Date 1487695366 -3600 # Node ID 2fb941d12d74e8353d2567456db50a2a502546b9 # Parent bb0dfc7d2d0e2b11e28a8e4b1b19edb9b59ad6c3 [pyramid] Move loading of pyramid_debugtoolbar later in includeme() To gather cwconfig and repository instantiations. diff -r bb0dfc7d2d0e -r 2fb941d12d74 cubicweb/pyramid/__init__.py --- a/cubicweb/pyramid/__init__.py Tue Feb 21 08:54:20 2017 +0100 +++ b/cubicweb/pyramid/__init__.py Tue Feb 21 17:42:46 2017 +0100 @@ -197,13 +197,6 @@ config.registry.settings['cubicweb.instance'], debugmode=debugmode) config.registry['cubicweb.config'] = cwconfig - if cwconfig.debugmode: - try: - config.include('pyramid_debugtoolbar') - except ImportError: - warn('pyramid_debugtoolbar package not available, install it to ' - 'get UI debug features', RuntimeWarning) - config.registry['cubicweb.repository'] = repo = cwconfig.repository() config.registry['cubicweb.registry'] = repo.vreg @@ -219,3 +212,10 @@ if asbool(config.registry.settings.get('cubicweb.bwcompat', True)): config.include('cubicweb.pyramid.bwcompat') + + if cwconfig.debugmode: + try: + config.include('pyramid_debugtoolbar') + except ImportError: + warn('pyramid_debugtoolbar package not available, install it to ' + 'get UI debug features', RuntimeWarning)