# HG changeset patch # User Thierry Florac # Date 1467985071 -7200 # Node ID f7693c6641a9e362592d0dc7ffdb5e2f3091abf8 # Parent 9698e68537811963ad3347845772ba8ff13907cf Added event object as context in workflow notifications diff -r 9698e6853781 -r f7693c6641a9 src/pyams_notify/handlers/workflow.py --- a/src/pyams_notify/handlers/workflow.py Fri Jul 08 15:37:20 2016 +0200 +++ b/src/pyams_notify/handlers/workflow.py Fri Jul 08 15:37:51 2016 +0200 @@ -41,6 +41,7 @@ return translate = request.localizer.translate notification = Notification(request=request, + context=event.object, action='notify', category='content.workflow', message=translate(transition.user_data['notify_message']).format( @@ -64,6 +65,7 @@ protection = IProtectedObject(context, None) if protection is not None: principals |= protection.get_principals(role_id) - if self.context.source['id'] in principals: - principals.remove(self.context.source['id']) + source_id = self.context.source['id'] + if source_id in principals: + principals.remove(source_id) return {'principals': tuple(principals)}