ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: причина отклонения, reply и in-app уведомления
This commit is contained in:
@@ -23,8 +23,10 @@ from plane.db.models import (
|
||||
IssueActivity,
|
||||
UserNotificationPreference,
|
||||
ProjectMember,
|
||||
IntakeIssue,
|
||||
)
|
||||
from django.db.models import Subquery
|
||||
from plane.utils.external_contours import create_external_contour_notification
|
||||
|
||||
# Third Party imports
|
||||
from celery import shared_task
|
||||
@@ -99,6 +101,10 @@ def extract_mentions_as_subscribers(project_id, issue_id, mentions):
|
||||
and ProjectMember.objects.filter(project_id=project_id, member_id=mention_id, is_active=True).exists()
|
||||
):
|
||||
project = Project.objects.get(pk=project_id)
|
||||
external_contour_request = IntakeIssue.objects.filter(
|
||||
issue_id=issue_id,
|
||||
extra__bridge="external-contours",
|
||||
).first()
|
||||
|
||||
bulk_mention_subscribers.append(
|
||||
IssueSubscriber(
|
||||
@@ -288,6 +294,10 @@ def notifications(
|
||||
)
|
||||
|
||||
issue = Issue.objects.filter(pk=issue_id).first()
|
||||
external_contour_request = IntakeIssue.objects.filter(
|
||||
issue_id=issue_id,
|
||||
extra__bridge="external-contours",
|
||||
).first()
|
||||
|
||||
if subscriber:
|
||||
# add the user to issue subscriber
|
||||
@@ -517,7 +527,19 @@ def notifications(
|
||||
},
|
||||
)
|
||||
)
|
||||
bulk_notifications.append(notification)
|
||||
|
||||
if external_contour_request is not None:
|
||||
for issue_activity in issue_activities_created:
|
||||
if issue_activity.get("issue_detail").get("id") != issue_id:
|
||||
continue
|
||||
|
||||
external_contour_notification = create_external_contour_notification(
|
||||
contour_request=external_contour_request,
|
||||
issue=issue,
|
||||
issue_activity_data=issue_activity,
|
||||
)
|
||||
if external_contour_notification is not None:
|
||||
bulk_notifications.append(external_contour_notification)
|
||||
|
||||
for mention_id in new_mentions:
|
||||
if mention_id != actor_id:
|
||||
|
||||
Reference in New Issue
Block a user