From 06a664f6b926dff66aefd489535aa7e2862f9850 Mon Sep 17 00:00:00 2001 From: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Date: Mon, 6 May 2024 16:07:56 +0530 Subject: [PATCH] [WEB-1151] fix: email notification for mentions (#4360) * chore: mention notification * chore: mention filters --- apiserver/plane/bgtasks/email_notification_task.py | 2 +- apiserver/plane/bgtasks/notification_task.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apiserver/plane/bgtasks/email_notification_task.py b/apiserver/plane/bgtasks/email_notification_task.py index 050f522c3..fa154828b 100644 --- a/apiserver/plane/bgtasks/email_notification_task.py +++ b/apiserver/plane/bgtasks/email_notification_task.py @@ -152,7 +152,7 @@ def process_mention(mention_component): soup = BeautifulSoup(mention_component, "html.parser") mentions = soup.find_all("mention-component") for mention in mentions: - user_id = mention["id"] + user_id = mention["entity_identifier"] user = User.objects.get(pk=user_id) user_name = user.display_name highlighted_name = f"@{user_name}" diff --git a/apiserver/plane/bgtasks/notification_task.py b/apiserver/plane/bgtasks/notification_task.py index 5725abc62..9dfd0c16d 100644 --- a/apiserver/plane/bgtasks/notification_task.py +++ b/apiserver/plane/bgtasks/notification_task.py @@ -128,7 +128,7 @@ def extract_mentions(issue_instance): "mention-component", attrs={"target": "users"} ) - mentions = [mention_tag["id"] for mention_tag in mention_tags] + mentions = [mention_tag["entity_identifier"] for mention_tag in mention_tags] return list(set(mentions)) except Exception: @@ -144,7 +144,7 @@ def extract_comment_mentions(comment_value): "mention-component", attrs={"target": "users"} ) for mention_tag in mentions_tags: - mentions.append(mention_tag["id"]) + mentions.append(mention_tag["entity_identifier"]) return list(set(mentions)) except Exception: return [] @@ -663,9 +663,7 @@ def notifications( "old_value": str( last_activity.old_value ), - "activity_time": issue_activity.get( - "created_at" - ), + "activity_time": str(last_activity.created_at), }, }, )