Skip to content

Commit

Permalink
fix: issue mentions (#6265)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 authored Dec 23, 2024
1 parent 34d114a commit 88737b1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apiserver/plane/bgtasks/notification_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

def update_mentions_for_issue(issue, project, new_mentions, removed_mention):
aggregated_issue_mentions = []

for mention_id in new_mentions:
aggregated_issue_mentions.append(
IssueMention(
Expand Down Expand Up @@ -125,7 +124,9 @@ def extract_mentions(issue_instance):
data = json.loads(issue_instance)
html = data.get("description_html")
soup = BeautifulSoup(html, "html.parser")
mention_tags = soup.find_all("mention-component", attrs={"target": "users"})
mention_tags = soup.find_all(
"mention-component", attrs={"entity_name": "user_mention"}
)

mentions = [mention_tag["entity_identifier"] for mention_tag in mention_tags]

Expand All @@ -139,7 +140,9 @@ def extract_comment_mentions(comment_value):
try:
mentions = []
soup = BeautifulSoup(comment_value, "html.parser")
mentions_tags = soup.find_all("mention-component", attrs={"target": "users"})
mentions_tags = soup.find_all(
"mention-component", attrs={"entity_name": "user_mention"}
)
for mention_tag in mentions_tags:
mentions.append(mention_tag["entity_identifier"])
return list(set(mentions))
Expand Down Expand Up @@ -255,12 +258,9 @@ def notifications(
new_mentions = get_new_mentions(
requested_instance=requested_data, current_instance=current_instance
)

new_mentions = [
str(mention)
for mention in new_mentions
if mention in set(project_members)
]
new_mentions = list(
set(new_mentions) & {str(member) for member in project_members}
)
removed_mention = get_removed_mentions(
requested_instance=requested_data, current_instance=current_instance
)
Expand Down

0 comments on commit 88737b1

Please sign in to comment.