# HG changeset patch # User Julien Cristau # Date 1371117683 -7200 # Node ID e4ea8f9ffa117e417be389100b29c6b55a0fe4e8 # Parent 63cf580accfce4437198a8c2ad8f6c2443b01650 notification: use viewargs for notif_entity_updated instead of transaction_data Now that notifications use separate sessions, they can't rely on the original transaction_data being around, so pass the data through view arguments instead, so the notification view knows what changed on updated entities. Closes #2936180 diff -r 63cf580accfc -r e4ea8f9ffa11 hooks/notification.py --- a/hooks/notification.py Thu Jun 13 12:03:59 2013 +0200 +++ b/hooks/notification.py Thu Jun 13 12:01:23 2013 +0200 @@ -158,7 +158,8 @@ view = session.vreg['views'].select('notif_entity_updated', session, rset=session.eid_rset(eid), row=0) - notify_on_commit(self.session, view) + notify_on_commit(self.session, view, + viewargs={'changes': session.transaction_data['changes'][eid]}) class EntityUpdateHook(NotificationHook): diff -r 63cf580accfc -r e4ea8f9ffa11 sobjects/notification.py --- a/sobjects/notification.py Thu Jun 13 12:03:59 2013 +0200 +++ b/sobjects/notification.py Thu Jun 13 12:01:23 2013 +0200 @@ -292,9 +292,8 @@ url: %(url)s """ - def context(self, **kwargs): + def context(self, changes=(), **kwargs): context = super(EntityUpdatedNotificationView, self).context(**kwargs) - changes = self._cw.transaction_data['changes'][self.cw_rset[0][0]] _ = self._cw._ formatted_changes = [] entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0)