patch chat

This commit is contained in:
2024-01-08 17:20:15 +01:00
parent 58d20920ea
commit 478456a199
8 changed files with 27 additions and 22 deletions

View File

@ -28,6 +28,9 @@ class ChannelView(APIView):
data: dict = serializer.validated_data
members_id = data.get("members_id")
if members_id == None:
return Response({"detail": "members_id is None."}, status = status.HTTP_400_BAD_REQUEST)
if self.request.user.pk not in members_id:
return Response({"detail": "You are trying to create a chat group without you."}, status = status.HTTP_400_BAD_REQUEST)