mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
🐛 POST and DELETE should be idempotent
This commit is contained in:
parent
7074b3f921
commit
363d1568b1
1 changed files with 0 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue