Changeset - 75e46ebf176d
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-03-31 17:43:31
mads@kiilerich.com
Grafted from: 133da89310e4
middleware: verify as early as possible in app initialization that the necessary configuration is provided

In addition to verifying a random config setting, also verify that config has
been read as Paste does it, an invariant introduced in 488b52cad890.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/config/middleware.py
Show inline comments
 
@@ -33,13 +33,15 @@ def make_app(global_conf, full_stack=Tru
 
        defined under the ``[DEFAULT]`` section).
 
    :type global_conf: dict
 
    :param full_stack: Should the whole TurboGears2 stack be set up?
 
    :type full_stack: str or bool
 
    :return: The Kallithea application with all the relevant middleware
 
        loaded.
 

	
 
    This is the PasteDeploy factory for the Kallithea application.
 

	
 
    ``app_conf`` contains all the application-specific settings (those defined
 
    under ``[app:main]``.
 
    """
 
    assert app_conf.get('sqlalchemy.url')  # must be called with a Kallithea .ini file, which for example must have this config option
 
    assert global_conf.get('here') and global_conf.get('__file__')  # app config should be initialized the paste way ...
 
    return make_base_app(global_conf, full_stack=full_stack, **app_conf)
0 comments (0 inline, 0 general)