server/repository.py
changeset 10018 72f3249b2f7d
parent 9984 793377697c81
child 10039 1d1afe3b5081
--- a/server/repository.py	Mon Jun 30 10:49:53 2014 +0200
+++ b/server/repository.py	Thu Jul 17 14:40:28 2014 +0200
@@ -651,8 +651,8 @@
                                    query_attrs)
             return rset.rows
 
-    def connect(self, login, **kwargs):
-        """open a session for a given user
+    def new_session(self, login, **kwargs):
+        """open a new session for a given user
 
         raise `AuthenticationError` if the authentication failed
         raise `ConnectionError` if we can't open a connection
@@ -678,7 +678,11 @@
             # commit connection at this point in case write operation has been
             # done during `session_open` hooks
             cnx.commit()
-        return session.sessionid
+        return session
+
+    def connect(self, login, **kwargs):
+        """open a new session for a given user and return its sessionid """
+        return self.new_session(login, **kwargs).sessionid
 
     def execute(self, sessionid, rqlstring, args=None, build_descr=True,
                 txid=None):