Commit 550748b3 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[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 <cube> <instance>` 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).

--HG--
branch : 3.25
parent c46f2bf815d2
......@@ -22,6 +22,7 @@
import atexit
import os
import warnings
import wsgicors
......@@ -240,5 +241,11 @@ def includeme(config):
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')
......@@ -23,7 +23,6 @@ pyramid.includes =
# 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
......
......@@ -76,7 +76,10 @@ The Pyramid CubicWeb specific configuration entries are:
.. 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)
......
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