From b906d84d8786d94dce1ac0a15e7f522da46bd24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 30 Jan 2019 10:02:36 +0100 Subject: [PATCH] Load payload using the JSONDecoder The payload is dumped using the JSONEncoder so it should be loaded using the proper decoder. issue8024 review56551002 --- trytond/bus.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trytond/bus.py b/trytond/bus.py index 6de02b12f0..5dfafb1c3f 100644 --- a/trytond/bus.py +++ b/trytond/bus.py @@ -21,7 +21,7 @@ from werkzeug.exceptions import NotImplemented, BadRequest from trytond import backend from trytond.wsgi import app from trytond.transaction import Transaction -from trytond.protocols.jsonrpc import JSONEncoder +from trytond.protocols.jsonrpc import JSONEncoder, JSONDecoder from trytond.config import config from trytond.tools import resolve @@ -162,7 +162,9 @@ class LongPollingBus: conn.poll() while conn.notifies: notification = conn.notifies.pop() - payload = json.loads(notification.payload) + payload = json.loads( + notification.payload, + object_hook=JSONDecoder()) channel = payload['channel'] message = payload['message'] messages.append(channel, message)