From 673ac49ca15f9ec57a04db82ab739e04b96d96fe Mon Sep 17 00:00:00 2001 From: "Jacob Mansfield [root@Helix]" Date: Wed, 17 Mar 2021 21:22:02 +0000 Subject: [PATCH] Handle both types of incoming websocket data --- app/YtManagerApp/consumers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/YtManagerApp/consumers.py b/app/YtManagerApp/consumers.py index 3f7ced1..06a87d8 100644 --- a/app/YtManagerApp/consumers.py +++ b/app/YtManagerApp/consumers.py @@ -25,7 +25,10 @@ class EventConsumer(WebsocketConsumer): http_user = True def receive(self, text=None, bytes=None, **kwargs): - text_data_json = json.loads(text) + if text: + text_data_json = json.loads(text) + elif bytes: + text_data_json = json.loads(bytes) request = text_data_json['request'] if request == "jobs":