From 3ae68028f2448f57430f75212a68edca637c0cb8 Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Fri, 3 May 2024 17:33:28 +0530 Subject: [PATCH 1/2] chore: mention notification --- apiserver/plane/bgtasks/email_notification_task.py | 2 +- apiserver/plane/bgtasks/notification_task.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apiserver/plane/bgtasks/email_notification_task.py b/apiserver/plane/bgtasks/email_notification_task.py index 050f522c33d..fa154828b84 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 5725abc624b..5b0b6949c93 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 [] From a8222a516265c1d20e97e3f7e914e57367518e5e Mon Sep 17 00:00:00 2001 From: NarayanBavisetti Date: Mon, 6 May 2024 15:00:54 +0530 Subject: [PATCH 2/2] chore: mention filters --- apiserver/plane/bgtasks/notification_task.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apiserver/plane/bgtasks/notification_task.py b/apiserver/plane/bgtasks/notification_task.py index 5b0b6949c93..9dfd0c16dc8 100644 --- a/apiserver/plane/bgtasks/notification_task.py +++ b/apiserver/plane/bgtasks/notification_task.py @@ -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), }, }, )