Subject: changeset in trytond:5.0 Load payload using the JSONDecoder From: Cédric Krier <[email protected]>
changeset c209d11bc94e in trytond:5.0 details: https://hg.tryton.org/trytond?cmd=changeset;node=c209d11bc94e description: Load payload using the JSONDecoder The payload is dumped using the JSONEncoder so it should be loaded using the proper decoder. issue8024 review56551002 (grafted from ea37edb1145999acbc0d181c1df8f3ccb3204cb2) diffstat: trytond/bus.py | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diffs (23 lines): diff -r 977c21104386 -r c209d11bc94e trytond/bus.py --- a/trytond/bus.py Wed Jan 30 09:36:21 2019 +0100 +++ b/trytond/bus.py Wed Jan 30 10:02:36 2019 +0100 @@ -15,7 +15,7 @@ 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 @@ -154,7 +154,9 @@ 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)
