From 8fe4d77e3d8ca59dd6457d750176515229951d3e Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 18 Dec 2018 14:59:10 +0100 Subject: [PATCH] Made requests parsing more robust against messages with target not set (e.g. messages received over HTTP API) --- platypush/message/request/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index 14db241d27..1f21d422ef 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -49,7 +49,7 @@ class Request(Message): def build(cls, msg): msg = super().parse(msg) args = { - 'target' : msg['target'], + 'target' : msg.get('target', Config.get('device_id')), 'action' : msg['action'], 'args' : msg['args'] if 'args' in msg else {}, }