FIX: don't trigger notifications when changing category/tags of unlisted topics (#7323)

This commit is contained in:
Maja Komel
2019-04-05 15:06:38 +02:00
committed by Régis Hanol
parent 8f4527c1f1
commit ca33d091b3
4 changed files with 25 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ module Jobs
def execute(args)
post = Post.find_by(id: args[:post_id])
if post&.topic
if post&.topic&.visible?
post_alerter = PostAlerter.new
post_alerter.notify_post_users(post, User.where(id: args[:notified_user_ids]))
post_alerter.notify_first_post_watchers(post, post_alerter.category_watchers(post.topic))

View File

@@ -5,7 +5,7 @@ module Jobs
def execute(args)
post = Post.find_by(id: args[:post_id])
if post&.topic
if post&.topic&.visible?
post_alerter = PostAlerter.new
post_alerter.notify_post_users(post, User.where(id: args[:notified_user_ids]))
post_alerter.notify_first_post_watchers(post, post_alerter.tag_watchers(post.topic))