Tweak how pyramid config is created during app startup, for tests
still not sure if this is quite right, but seems to work for now
This commit is contained in:
parent
ec4e52fa1a
commit
b309df005c
|
@ -125,11 +125,15 @@ def make_pyramid_config(settings):
|
|||
from tailbone.forms.alchemy import TemplateEngine
|
||||
from tailbone.forms import renderers
|
||||
|
||||
config = settings.pop('pyramid_config', None)
|
||||
if config:
|
||||
config.set_root_factory(Root)
|
||||
else:
|
||||
config = Configurator(settings=settings, root_factory=Root)
|
||||
|
||||
# Configure user authentication / authorization.
|
||||
config.set_authentication_policy(SessionAuthenticationPolicy())
|
||||
# configure user authorization / authentication
|
||||
config.set_authorization_policy(TailboneAuthorizationPolicy())
|
||||
config.set_authentication_policy(SessionAuthenticationPolicy())
|
||||
|
||||
# always require CSRF token protection
|
||||
config.set_default_csrf_options(require_csrf=True, token='_csrf')
|
||||
|
|
Loading…
Reference in a new issue