Skip to content

Commit

Permalink
mentioned users in comments are discarded, closes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
muremwa committed May 1, 2023
1 parent 435a0f0 commit d7445b3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ def comment_actions_v2(request, comment_pk):
comment.comment_text = processed_comment.get('processed_comment')
comment.modified = timezone.now()
comment.save()
notify = []

# add mentioned users
# notify users
notify = []
for mentioned in processed_comment.get('mentioned'):
if mentioned.profile not in comment.mentioned.all():
comment.mentioned.add(mentioned.profile)
if mentioned.profile not in comment.mentioned.all() and mentioned != comment.note.user:
notify.append(mentioned)

if mentioned != comment.note.user:
notify.append(mentioned)
# add mentioned users
comment.mentioned.set(map(lambda usr: usr.profile, processed_comment.get('mentioned')))

# notify new mentioned users
if notify:
Expand Down

0 comments on commit d7445b3

Please # to comment.