sobjects/notification.py
changeset 8933 ac76925268a3
parent 8932 4ae4242bceb1
child 9004 a3594bf2b6bf
--- a/sobjects/notification.py	Thu Apr 25 13:35:02 2013 +0200
+++ b/sobjects/notification.py	Thu Apr 25 12:24:26 2013 +0200
@@ -30,6 +30,7 @@
 from cubicweb.view import Component, EntityView
 from cubicweb.server.hook import SendMailOp
 from cubicweb.mail import construct_message_id, format_mail
+from cubicweb.server.session import Session
 
 
 class RecipientsFinder(Component):
@@ -118,7 +119,7 @@
         for something in recipients:
             if isinstance(something, Entity):
                 # hi-jack self._cw to get a session for the returned user
-                self._cw = self._cw.hijack_user(something)
+                self._cw = Session(self._cw.repo, something)
                 emailaddr = something.cw_adapt_to('IEmailable').get_email()
             else:
                 emailaddr, lang = something