mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: show created by empty for viewers and guests (#1740)
* chore: show created by empty for viewers and guests * dev: return empty queryset
This commit is contained in:
parent
6e7fa1a39c
commit
1a5faca77c
@ -10,7 +10,7 @@ from plane.utils.paginator import BasePaginator
|
|||||||
|
|
||||||
# Module imports
|
# Module imports
|
||||||
from .base import BaseViewSet, BaseAPIView
|
from .base import BaseViewSet, BaseAPIView
|
||||||
from plane.db.models import Notification, IssueAssignee, IssueSubscriber, Issue
|
from plane.db.models import Notification, IssueAssignee, IssueSubscriber, Issue, WorkspaceMember
|
||||||
from plane.api.serializers import NotificationSerializer
|
from plane.api.serializers import NotificationSerializer
|
||||||
|
|
||||||
|
|
||||||
@ -83,10 +83,13 @@ class NotificationViewSet(BaseViewSet, BasePaginator):
|
|||||||
|
|
||||||
# Created issues
|
# Created issues
|
||||||
if type == "created":
|
if type == "created":
|
||||||
issue_ids = Issue.objects.filter(
|
if WorkspaceMember.objects.filter(workspace__slug=slug, member=request.user, role__lt=15).exists():
|
||||||
workspace__slug=slug, created_by=request.user
|
notifications = Notification.objects.none()
|
||||||
).values_list("pk", flat=True)
|
else:
|
||||||
notifications = notifications.filter(entity_identifier__in=issue_ids)
|
issue_ids = Issue.objects.filter(
|
||||||
|
workspace__slug=slug, created_by=request.user
|
||||||
|
).values_list("pk", flat=True)
|
||||||
|
notifications = notifications.filter(entity_identifier__in=issue_ids)
|
||||||
|
|
||||||
# Pagination
|
# Pagination
|
||||||
if request.GET.get("per_page", False) and request.GET.get("cursor", False):
|
if request.GET.get("per_page", False) and request.GET.get("cursor", False):
|
||||||
|
Loading…
Reference in New Issue
Block a user