cubicweb/server/repository.py
changeset 12043 b8d2e6b9f548
parent 12036 4c2c731f9190
child 12044 70bb46dfa87b
--- a/cubicweb/server/repository.py	Fri Mar 10 18:00:13 2017 +0100
+++ b/cubicweb/server/repository.py	Tue Mar 14 11:07:58 2017 +0100
@@ -47,7 +47,7 @@
 from cubicweb import set_log_methods
 from cubicweb import cwvreg, schema, server
 from cubicweb.server import utils, hook, querier, sources
-from cubicweb.server.session import Session, InternalManager
+from cubicweb.server.session import InternalManager, Connection
 
 
 NO_CACHE_RELATIONS = set([
@@ -667,7 +667,7 @@
 
         Internal connections have all hooks beside security enabled.
         """
-        with Session(InternalManager(), self).new_cnx() as cnx:
+        with Connection(self, InternalManager()) as cnx:
             cnx.user._cw = cnx  # XXX remove when "vreg = user._cw.vreg" hack in entity.py is gone
             with cnx.security_enabled(read=False, write=False):
                 yield cnx