FIX: NotifyMailingListSubscribers can handle trashed posts, instead of raising an error and retrying

This commit is contained in:
Neil Lalonde 2014-04-23 15:50:52 -04:00
parent e48cf06fc9
commit d8ebeef857
1 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,10 @@ module Jobs
def execute(args)
post_id = args[:post_id]
post = Post.find(post_id) if post_id
if post_id
post = Post.with_deleted.where(id: post_id).first
return if post && post.trashed?
end
raise Discourse::InvalidParameters.new(:post_id) unless post