From f007dcff266257177acd696fc4334199012e8856 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Thu, 25 Jan 2024 00:48:18 +0530 Subject: [PATCH] fix: page archive and unarchive (#3459) --- apiserver/plane/app/views/page.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apiserver/plane/app/views/page.py b/apiserver/plane/app/views/page.py index d7bff43d6..1d8ff1fbb 100644 --- a/apiserver/plane/app/views/page.py +++ b/apiserver/plane/app/views/page.py @@ -158,18 +158,18 @@ class PageViewSet(BaseViewSet): pk=page_id, workspace__slug=slug, project_id=project_id ) - # only the owner and admin can archive the page + # only the owner or admin can archive the page if ( ProjectMember.objects.filter( project_id=project_id, member=request.user, is_active=True, - role__gte=20, + role__lte=15, ).exists() - or request.user.id != page.owned_by_id + and request.user.id != page.owned_by_id ): return Response( - {"error": "Only the owner and admin can archive the page"}, + {"error": "Only the owner or admin can archive the page"}, status=status.HTTP_400_BAD_REQUEST, ) @@ -182,18 +182,18 @@ class PageViewSet(BaseViewSet): pk=page_id, workspace__slug=slug, project_id=project_id ) - # only the owner and admin can un archive the page + # only the owner or admin can un archive the page if ( ProjectMember.objects.filter( project_id=project_id, member=request.user, is_active=True, - role__gt=20, + role__lte=15, ).exists() - or request.user.id != page.owned_by_id + and request.user.id != page.owned_by_id ): return Response( - {"error": "Only the owner and admin can un archive the page"}, + {"error": "Only the owner or admin can un archive the page"}, status=status.HTTP_400_BAD_REQUEST, )