equal
deleted
inserted
replaced
13 import cubicweb.web |
13 import cubicweb.web |
14 from cubicweb.server import session as cwsession |
14 from cubicweb.server import session as cwsession |
15 |
15 |
16 from pyramid import httpexceptions |
16 from pyramid import httpexceptions |
17 |
17 |
18 from pyramid_cubicweb import authplugin, tools |
18 from pyramid_cubicweb import tools |
19 |
19 |
20 import logging |
20 import logging |
21 |
21 |
22 log = logging.getLogger(__name__) |
22 log = logging.getLogger(__name__) |
23 |
23 |
336 with repo.internal_cnx() as cnx: |
336 with repo.internal_cnx() as cnx: |
337 login = config.registry['cubicweb.config'].anonymous_user()[0] |
337 login = config.registry['cubicweb.config'].anonymous_user()[0] |
338 config.registry['cubicweb.anonymous_eid'] = cnx.find( |
338 config.registry['cubicweb.anonymous_eid'] = cnx.find( |
339 'CWUser', login=login).one().eid |
339 'CWUser', login=login).one().eid |
340 |
340 |
341 repo.system_source.add_authentifier(authplugin.DirectAuthentifier()) |
|
342 |
|
343 config.add_request_method( |
341 config.add_request_method( |
344 _cw_session, name='cw_session', property=True, reify=True) |
342 _cw_session, name='cw_session', property=True, reify=True) |
345 config.add_request_method( |
343 config.add_request_method( |
346 _cw_cnx, name='cw_cnx', property=True, reify=True) |
344 _cw_cnx, name='cw_cnx', property=True, reify=True) |
347 config.add_request_method( |
345 config.add_request_method( |