From 4e9abf81b87faed7e9172c8a6972a6c8cbdfecf2 Mon Sep 17 00:00:00 2001 From: boyska Date: Fri, 24 Sep 2021 00:53:30 +0200 Subject: [PATCH] FIX double-encoding of json --- pizzicore/pizzicore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pizzicore/pizzicore.py b/pizzicore/pizzicore.py index dc91cd9..a4765d6 100644 --- a/pizzicore/pizzicore.py +++ b/pizzicore/pizzicore.py @@ -138,7 +138,7 @@ async def websocket_counter(websocket: WebSocket, cid: int): while True: try: val = counter_store.get(cid) - await websocket.send_json(Value(counter=cid, value=val).json()) + await websocket.send_json(jsonable_encoder(Value(counter=cid, value=val))) except WebSocketDisconnect: logging.debug("client disconnected") manager.unsubscribe(cid, q)