Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion apiserver/plane/bgtasks/notification_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
IssueComment,
IssueActivity,
UserNotificationPreference,
ProjectMember
)

# Third Party imports
Expand Down Expand Up @@ -94,6 +95,8 @@ def extract_mentions_as_subscribers(project_id, issue_id, mentions):
).exists()
and not Issue.objects.filter(
project_id=project_id, pk=issue_id, created_by_id=mention_id
).exists() and ProjectMember.objects.filter(
project_id=project_id, member_id=mention_id, is_active=True
).exists()
):
project = Project.objects.get(pk=project_id)
Expand Down Expand Up @@ -243,6 +246,10 @@ def notifications(
new_mentions = get_new_mentions(
requested_instance=requested_data, current_instance=current_instance
)
new_mentions = list(ProjectMember.objects.filter(
project_id=project_id, member_id__in=new_mentions, is_active=True
).values_list("member_id", flat=True))
new_mentions = [str(member_id) for member_id in new_mentions]
removed_mention = get_removed_mentions(
requested_instance=requested_data, current_instance=current_instance
)
Expand Down Expand Up @@ -286,7 +293,7 @@ def notifications(

# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- #
issue_subscribers = list(
IssueSubscriber.objects.filter(project_id=project_id, issue_id=issue_id)
IssueSubscriber.objects.filter(project_id=project_id, issue_id=issue_id, project__project_projectmember__is_active=True,)
.exclude(
subscriber_id__in=list(new_mentions + comment_mentions + [actor_id])
)
Expand Down
1 change: 1 addition & 0 deletions apiserver/plane/utils/issue_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def filter_labels(params, issue_filter, method, prefix=""):
and params.get("labels") != "null"
):
issue_filter[f"{prefix}labels__in"] = params.get("labels")
issue_filter[f"{prefix}label_issue__deleted_at__isnull"] = True
return issue_filter


Expand Down