# HG changeset patch # User Pierre-Yves David # Date 1366885466 -7200 # Node ID ac76925268a38b0da113526644b7ff53c516a630 # Parent 4ae4242bceb1e7064292df1d51e5bf6e5eba5062 [mail] drop hijack_user usage The transaction is now commited before notification. We can create a new session directly and drop `hijack_user` usage. This prepare #2781782 diff -r 4ae4242bceb1 -r ac76925268a3 sobjects/notification.py --- 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