mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: NotifyMailingListSubscribers can handle trashed posts, instead of raising an error and retrying
This commit is contained in:
parent
e48cf06fc9
commit
d8ebeef857
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue