fix: project join for admin and members (#6097)

* chore: add enum role comparison

* chore: add member also to join a project
This commit is contained in:
Nikhil
2024-11-26 16:58:41 +05:30
committed by GitHub
parent c4a5c5973f
commit 76fe136d85

View File

@@ -136,7 +136,7 @@ class UserProjectInvitationsViewset(BaseViewSet):
member=request.user, workspace__slug=slug, is_active=True
)
if workspace_member.role != ROLE.ADMIN:
if workspace_member.role not in [ROLE.ADMIN.value, ROLE.MEMBER.value]:
return Response(
{"error": "You do not have permission to join the project"},
status=status.HTTP_403_FORBIDDEN,