diff --git a/tildes/consumers/comment_user_mentions_generator.py b/tildes/consumers/comment_user_mentions_generator.py index dea5c0f..265bde8 100644 --- a/tildes/consumers/comment_user_mentions_generator.py +++ b/tildes/consumers/comment_user_mentions_generator.py @@ -16,6 +16,11 @@ class CommentUserMentionGenerator(PgsqlQueueConsumer): .filter_by(comment_id=msg.body['comment_id']) .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( self.db_session, comment)