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:
parent
c4a5c5973f
commit
76fe136d85
1 changed files with 1 additions and 1 deletions
|
|
@ -136,7 +136,7 @@ class UserProjectInvitationsViewset(BaseViewSet):
|
||||||
member=request.user, workspace__slug=slug, is_active=True
|
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(
|
return Response(
|
||||||
{"error": "You do not have permission to join the project"},
|
{"error": "You do not have permission to join the project"},
|
||||||
status=status.HTTP_403_FORBIDDEN,
|
status=status.HTTP_403_FORBIDDEN,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue