mirror of
https://github.com/discourse/discourse.git
synced 2025-06-08 23:56:58 +08:00
FIX: NotifyMailingListSubscribers can handle trashed posts, instead of raising an error and retrying
This commit is contained in:
@ -4,7 +4,10 @@ module Jobs
|
|||||||
|
|
||||||
def execute(args)
|
def execute(args)
|
||||||
post_id = args[:post_id]
|
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
|
raise Discourse::InvalidParameters.new(:post_id) unless post
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user