Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

fix: notification count (#6109)

Bavisetti Narayan378e896bf063
diff --git a/apiserver/plane/app/views/notification/base.py b/apiserver/plane/app/views/notification/base.py
index 11d18ade39..d2aa1a02d7 100644
--- a/apiserver/plane/app/views/notification/base.py
+++ b/apiserver/plane/app/views/notification/base.py
@@ -62,10 +62,6 @@ class NotificationViewSet(BaseViewSet, BasePaginator):
Notification.objects.filter(
workspace__slug=slug, receiver_id=request.user.id
)
- .filter(
- project__project_projectmember__member=request.user,
- project__project_projectmember__is_active=True,
- )
.filter(entity_name="issue")
.annotate(is_inbox_issue=Exists(intake_issue))
.annotate(is_intake_issue=Exists(intake_issue))
diff --git a/apiserver/plane/bgtasks/notification_task.py b/apiserver/plane/bgtasks/notification_task.py
index 2adff6cc62..ade2479096 100644
--- a/apiserver/plane/bgtasks/notification_task.py
+++ b/apiserver/plane/bgtasks/notification_task.py
@@ -1,6 +1,8 @@
# Python imports
import json
import uuid
+from uuid import UUID
+
# Module imports
from plane.db.models import (
@@ -255,7 +257,7 @@ def notifications(
)
new_mentions = [
- str(mention) for mention in new_mentions if mention in new_mentions
+ str(mention) for mention in new_mentions if mention in set(project_members)
]
removed_mention = get_removed_mentions(
requested_instance=requested_data, current_instance=current_instance
@@ -287,6 +289,11 @@ def notifications(
new_value=issue_comment_new_value,
)
comment_mentions = comment_mentions + new_comment_mentions
+ comment_mentions = [
+ mention
+ for mention in comment_mentions
+ if UUID(mention) in set(project_members)
+ ]
comment_mention_subscribers = extract_mentions_as_subscribers(
project_id=project_id, issue_id=issue_id, mentions=all_comment_mentions