pyramid_cubicweb/init_instance.py
author Julien Cristau <julien.cristau@logilab.fr>
Fri, 01 Apr 2016 16:50:12 +0200
changeset 11615 7e798fe70014
parent 11492 b0b8942cdb80
permissions -rw-r--r--
[bwcompat] send 403 on authentication errors (closes #12219849) 200 is just wrong.

from cubicweb.cwconfig import CubicWebConfiguration


def includeme(config):
    appid = config.registry.settings['cubicweb.instance']
    cwconfig = CubicWebConfiguration.config_for(appid)

    config.registry['cubicweb.config'] = cwconfig
    config.registry['cubicweb.repository'] = repo = cwconfig.repository()
    config.registry['cubicweb.registry'] = repo.vreg