Skip to content

Commit

Permalink
Handle both types of incoming websocket data
Browse files Browse the repository at this point in the history
  • Loading branch information
girlpunk committed Mar 17, 2021
1 parent 5d6994e commit 673ac49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/YtManagerApp/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 673ac49

Please sign in to comment.