# HG changeset patch # User Thierry Florac # Date 1499854460 -7200 # Node ID a285b7e8217c3fa5e47ec20060a1df69ad124104 # Parent d3490a8d72722310216631475cad0039fe3d30d4 Removed 'target' attribute from received notifications diff -r d3490a8d7272 -r a285b7e8217c src/pyams_notify_ws/notify.py --- a/src/pyams_notify_ws/notify.py Thu Jun 01 16:45:38 2017 +0200 +++ b/src/pyams_notify_ws/notify.py Wed Jul 12 12:14:20 2017 +0200 @@ -61,8 +61,10 @@ action = message.get('action') if action == 'notify': # dispatch notification to subscribers - json_message = json.dumps(message) - target = message.get('target').get('principals', ()) + target = message.get('target', {}).get('principals', ()) + clean_message = message.copy() + clean_message.pop('target') + json_message = json.dumps(clean_message) for connection, subscription in users.items(): if subscription.filter_target(target): yield from connection.send(json_message)