# HG changeset patch # User Denis Laxalde # Date 1496744417 -7200 # Node ID 36f1c7ab901006ad3030a26ac12ec4ee00629a80 # Parent c46f2bf815d2be2f10fe855dc05b9fe7fa233eb8 [pyramid] Only expose 'cubicweb.bwcompat' setting for "all-in-one" configuration type The "pyramid" instance configuration does not work with "cubiwceb.bwcompat" mode (on purpose). Yet, having the setting exposed in development.ini file (generate by `cubicweb-ctl create --config pyramid ` command) is misleading and we want to remove it. Thus, we only query this setting when cubicweb configuration is "all-in-one" and drop the setting line from templated development.ini file. If the option is found and True for any other configuration type, we issue a user warning (and ignore the option). diff -r c46f2bf815d2 -r 36f1c7ab9010 cubicweb/pyramid/__init__.py --- a/cubicweb/pyramid/__init__.py Thu Apr 27 10:16:39 2017 +0200 +++ b/cubicweb/pyramid/__init__.py Tue Jun 06 12:20:17 2017 +0200 @@ -22,6 +22,7 @@ import atexit import os +import warnings import wsgicors @@ -240,5 +241,11 @@ config.include('cubicweb.pyramid.core') - if asbool(config.registry.settings.get('cubicweb.bwcompat', True)): - config.include('cubicweb.pyramid.bwcompat') + if asbool(config.registry.settings.get('cubicweb.bwcompat', + cwconfig.name == 'all-in-one')): + if cwconfig.name != 'all-in-one': + warnings.warn('"cubicweb.bwcompat" setting only applies to ' + '"all-in-one" instance configuration', + UserWarning) + else: + config.include('cubicweb.pyramid.bwcompat') diff -r c46f2bf815d2 -r 36f1c7ab9010 cubicweb/pyramid/development.ini.tmpl --- a/cubicweb/pyramid/development.ini.tmpl Thu Apr 27 10:16:39 2017 +0200 +++ b/cubicweb/pyramid/development.ini.tmpl Tue Jun 06 12:20:17 2017 +0200 @@ -23,7 +23,6 @@ # http://cubicweb.readthedocs.io/en/latest/book/pyramid/settings/ ## cubicweb.instance = %(instance)s -cubicweb.bwcompat = false cubicweb.debug = true cubicweb.session.secret = %(session-secret)s cubicweb.auth.authtkt.persistent.secure = false diff -r c46f2bf815d2 -r 36f1c7ab9010 doc/book/pyramid/settings.rst --- a/doc/book/pyramid/settings.rst Thu Apr 27 10:16:39 2017 +0200 +++ b/doc/book/pyramid/settings.rst Tue Jun 06 12:20:17 2017 +0200 @@ -76,7 +76,10 @@ .. confval:: cubicweb.bwcompat (bool) - (True) Enable/disable backward compatibility. See :ref:`bwcompat_module`. + (True) Enable/disable backward compatibility. This only applies to + "all-in-one" configuration type. + + See :ref:`bwcompat_module`. .. confval:: cubicweb.bwcompat.errorhandler (bool)