fix: fix nomenclature update on permission filter attributes (#179)

This commit is contained in:
pablohashescobar 2023-01-17 03:33:36 +05:30 committed by GitHub
parent 894e26116b
commit acf7f59eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,7 @@ class ProjectMemberPermission(BasePermission):
## Safe Methods -> Handle the filtering logic in queryset
if request.method in SAFE_METHODS:
return ProjectMember.objects.filter(
workspace=view.workspace, member=request.user
workspace__slug=view.workspace_slug, member=request.user
).exists()
## Only workspace owners or admins can create the projects
if request.method == "POST":
@ -77,7 +77,7 @@ class ProjectEntityPermission(BasePermission):
## Safe Methods -> Handle the filtering logic in queryset
if request.method in SAFE_METHODS:
return ProjectMember.objects.filter(
workspace=view.workspace,
workspace__slug=view.workspace_slug,
member=request.user,
project_id=view.project_id,
).exists()