From 8ced8af81862f4332e13fc753cfc6bef44e0bc03 Mon Sep 17 00:00:00 2001 From: Brandon <103316367+okbrandon@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:37:36 +0100 Subject: [PATCH] api: Fixed conversations at register --- backend/api/views/auth.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/backend/api/views/auth.py b/backend/api/views/auth.py index 64b3848..ebd7b60 100644 --- a/backend/api/views/auth.py +++ b/backend/api/views/auth.py @@ -61,19 +61,6 @@ def post(self, request, *args, **kwargs): status=1 # Accepted/friends status ) - # Create the conversation between the user and the AI - friend = User.objects.get(userID='user_ai') - existing_conversation = Conversation.objects.filter( - participants__userID__in=[user.userID, 'user_ai'], - conversationType='private_message' - ).annotate(participant_count=Count('participants')).filter(participant_count=2).exists() - - if not existing_conversation: - new_conversation = Conversation.objects.create(conversationID=generate_id("conv"), conversationType='private_message') - new_conversation.receipientID = user.userID - new_conversation.participants.add(user, friend) - new_conversation.save() - if not skip_email_verification: verification_code = generate_id('code') VerificationCode.objects.create(