From f4feb79981f0e6287ab09948193fe76ed9a5d73a Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Tue, 17 Nov 2020 21:16:53 +0100 Subject: [PATCH] Remove timespan --- apps/chat/consumers.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/chat/consumers.py b/apps/chat/consumers.py index addef05..576717f 100644 --- a/apps/chat/consumers.py +++ b/apps/chat/consumers.py @@ -27,7 +27,6 @@ class ChatConsumer(AsyncWebsocketConsumer): text_data_json = json.loads(text_data) name = text_data_json["name"] text = text_data_json["text"] - created_at = text_data_json["createdAt"] # Enviamos el mensaje a la sala await self.channel_layer.group_send( @@ -35,16 +34,15 @@ class ChatConsumer(AsyncWebsocketConsumer): { "type": "chat_message", "name": name, - "text": text, - "created_at": created_at, + "text": text }, ) async def chat_message(self, event): ''' Recibimos informaciĆ³n de la sala ''' + print(self.channel_layer.group_channels('chat_python')) name = event["name"] text = event["text"] - created_at = event["created_at"] # Send message to WebSocket await self.send( @@ -52,8 +50,7 @@ class ChatConsumer(AsyncWebsocketConsumer): { "type": "chat_message", "name": name, - "text": text, - "created_at": created_at + "text": text } ) )