[pyramid] Move loading of pyramid_debugtoolbar later in includeme()
To gather cwconfig and repository instantiations.
--- 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)