mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
FIX: don't send mailing list for post with empty content (#10577)
discourse-assign is creating posts with empty content to show that a specific user was assign/unassigned for a specific topic. It is causing confusing emails with empty content The bug was mentioned here: https://meta.discourse.org/t/again-on-empty-emails-and-notifications-generated-on-topic-assignment/162213
This commit is contained in:
parent
de038c0eab
commit
9954a677ab
@ -26,7 +26,7 @@ module Jobs
|
||||
post_id = args[:post_id]
|
||||
post = post_id ? Post.with_deleted.find_by(id: post_id) : nil
|
||||
|
||||
return if !post || post.trashed? || post.user_deleted? || !post.topic
|
||||
return if !post || post.trashed? || post.user_deleted? || !post.topic || post.raw.blank?
|
||||
|
||||
users =
|
||||
User.activated.not_silenced.not_suspended.real
|
||||
|
@ -65,6 +65,11 @@ describe Jobs::NotifyMailingListSubscribers do
|
||||
include_examples "no emails"
|
||||
end
|
||||
|
||||
context "with a empty post" do
|
||||
before { post.update_columns(raw: "") }
|
||||
include_examples "no emails"
|
||||
end
|
||||
|
||||
context "with a user_deleted post" do
|
||||
before { post.update(user_deleted: true) }
|
||||
include_examples "no emails"
|
||||
|
Loading…
Reference in New Issue
Block a user