pyramid_cubicweb/core.py
changeset 11500 8e4935a1848b
parent 11498 a8aaff87c1fc
child 11502 e4682c567e86
--- a/pyramid_cubicweb/core.py	Thu Aug 21 21:43:24 2014 +0200
+++ b/pyramid_cubicweb/core.py	Thu Aug 21 22:26:42 2014 +0200
@@ -125,7 +125,11 @@
 
 
 def _cw_close_session(request):
-    request.cw_session.close()
+    # XXX Closing the session will actually depend on the cubicweb version.
+    # The following code is correct for cw-3.19.
+    # Later versions will have the notion of detached sessions that should not
+    # need explicit closing, or at least not a repository-related one.
+    request.registry['cubicweb.repository'].close(request.cw_session.sessionid)
 
 
 def _cw_session(request):