From ff5c271d1a3b582366c561d730daf8472f2bcff1 Mon Sep 17 00:00:00 2001 From: Gregor Zurowski Date: Fri, 31 May 2024 14:07:27 +0000 Subject: [PATCH] Add some logs --- src/user/consumers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/user/consumers.py b/src/user/consumers.py index ea906f9e8..852af43c6 100644 --- a/src/user/consumers.py +++ b/src/user/consumers.py @@ -57,6 +57,7 @@ def get_dynamic_paper_serializer(data, **kwargs): class PaperSubmissionConsumer(AsyncWebsocketConsumer): async def connect(self): + print("connect...") if "user" not in self.scope: self.close(code=401) raise StopConsumer() @@ -76,6 +77,7 @@ async def connect(self): await self.accept(subprotocol="Token") async def receive(self, text_data=None, bytes_data=None): + print("receive...") # TODO: Sanitize data? data = json.loads(text_data) submission_id = data["paper_submission_id"] @@ -84,6 +86,7 @@ async def receive(self, text_data=None, bytes_data=None): await self.notify_paper_submission_status({"id": submission_id}) async def disconnect(self, close_code): + print("disconnect...") if close_code == 401 or not hasattr(self, "room_group_name"): return else: @@ -100,6 +103,7 @@ async def _get_duplicate_paper_data(self, ids): return data async def notify_paper_submission_status(self, event): + print("notify_paper_submission_status...") # Send message to webSocket (Frontend) extra_metadata = {} submission_id = event["id"]