Browse Source

Skip deleted/removed comments in mentions consumer

merge-requests/25/head
Deimos 6 years ago
parent
commit
f388b86306
  1. 5
      tildes/consumers/comment_user_mentions_generator.py

5
tildes/consumers/comment_user_mentions_generator.py

@ -16,6 +16,11 @@ class CommentUserMentionGenerator(PgsqlQueueConsumer):
.filter_by(comment_id=msg.body['comment_id']) .filter_by(comment_id=msg.body['comment_id'])
.one() .one()
) )
# don't generate mentions for deleted/removed comments
if comment.is_deleted or comment.is_removed:
return
new_mentions = CommentNotification.get_mentions_for_comment( new_mentions = CommentNotification.get_mentions_for_comment(
self.db_session, comment) self.db_session, comment)

Loading…
Cancel
Save