[WEB-1151] fix: email notification for mentions (#4360)

* chore: mention notification

* chore: mention filters
This commit is contained in:
Bavisetti Narayan 2024-05-06 16:07:56 +05:30 committed by GitHub
parent cdab12e4b6
commit 06a664f6b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -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}"

View File

@ -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),
},
},
)