[service] split session retrieval and service execution
Internal session are not tracker by the repository and can not be retrieved
using _getsession. Moreover their session id is not unique…
Closes #2735700
--- a/server/repository.py Tue Apr 02 15:11:21 2013 +0200
+++ b/server/repository.py Tue Apr 02 15:11:41 2013 +0200
@@ -883,6 +883,9 @@
and :class:`cubicweb.server.Service`
"""
session = self._get_session(sessionid)
+ return self._call_service_with_session(session, regid, async, **kwargs)
+
+ def _call_service_with_session(self, session, regid, async, **kwargs):
if async:
self.info('calling service %s asynchronously', regid)
def task():
--- a/server/session.py Tue Apr 02 15:11:21 2013 +0200
+++ b/server/session.py Tue Apr 02 15:11:41 2013 +0200
@@ -808,7 +808,8 @@
# server-side service call #################################################
def call_service(self, regid, async=False, **kwargs):
- return self.repo.call_service(self.id, regid, async, **kwargs)
+ return self.repo._call_service_with_session(self, regid, async,
+ **kwargs)
# request interface #######################################################