fix: project member role update (#1205)

This commit is contained in:
pablohashescobar 2023-06-05 17:45:10 +05:30 committed by GitHub
parent 2511a284eb
commit 77e05a3599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,7 +424,7 @@ class ProjectMemberViewSet(BaseViewSet):
) )
# Check while updating user roles # Check while updating user roles
requested_project_member = ProjectMember.objects.get(project_id=project_id, workspace__slug=slug, member=request.user) requested_project_member = ProjectMember.objects.get(project_id=project_id, workspace__slug=slug, member=request.user)
if "role" in request.data and request.data.get("role", project_member.role) > requested_project_member.role: if "role" in request.data and int(request.data.get("role", project_member.role)) > requested_project_member.role:
return Response( return Response(
{ {
"error": "You cannot update a role that is higher than your own role" "error": "You cannot update a role that is higher than your own role"