From 363d1568b1109e927f2dee9d01e5b7471b829641 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 29 Oct 2021 01:07:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20POST=20and=20DELETE=20should=20b?= =?UTF-8?q?e=20idempotent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/sophon/core/views.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/backend/sophon/core/views.py b/backend/sophon/core/views.py index a208ef8..74e0648 100644 --- a/backend/sophon/core/views.py +++ b/backend/sophon/core/views.py @@ -262,10 +262,6 @@ class ResearchGroupViewSet(WriteSophonViewSet): """ group = models.ResearchGroup.objects.get(pk=pk) - # Raise an error if the user is already in the group - if self.request.user in group.members.all(): - return Response(status=s.HTTP_409_CONFLICT) - # Raise an error if the group doesn't allow member joins if group.access != "OPEN": return Response(status=s.HTTP_403_FORBIDDEN) @@ -287,10 +283,6 @@ class ResearchGroupViewSet(WriteSophonViewSet): """ group = models.ResearchGroup.objects.get(pk=pk) - # Raise an error if the user is not in the group - if self.request.user not in group.members.all(): - return Response(status=s.HTTP_409_CONFLICT) - # Raise an error if the user is the owner of the group if self.request.user == group.owner: return Response(status=s.HTTP_403_FORBIDDEN)