From 634a2b73e4d3e0f78adcd964b40eab5040532c20 Mon Sep 17 00:00:00 2001 From: Kilton937342 Date: Thu, 28 Jul 2022 11:24:34 +0200 Subject: [PATCH] consumer original --- backend/api/room/consumers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/api/room/consumers.py b/backend/api/room/consumers.py index 0151cbf6..78976d07 100644 --- a/backend/api/room/consumers.py +++ b/backend/api/room/consumers.py @@ -22,8 +22,8 @@ class RoomConsumer(AsyncWebsocketConsumer): await self.accept() await self.send(json.dumps({'type': 'connect', "clientId": self.clientId})) + except: - print('test') await self.close() async def receive(self, text_data): @@ -178,7 +178,7 @@ class RoomConsumer(AsyncWebsocketConsumer): elif type == "reconnect": client = text_data_json['data']['clientId'] - + print(not self.scope['user'].is_anonymous, "USERED", self.scope['user']) if not self.scope['user'].is_anonymous: userInRoom = await self.userInRoom() if not userInRoom: @@ -205,7 +205,8 @@ class RoomConsumer(AsyncWebsocketConsumer): else: participants = await self.get_participants() - + print(client in list( + map(lambda p: p['clientId'], participants)), client, list(map(lambda p: p['clientId'], participants))) if client in list(map(lambda p: p['clientId'], participants)): self.clientId = client