mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: ensures global notices are destroyed on post created (#28684)
Prior to this fix we could exit early if tags was `[]` as `tags && (tags & post.topic.tags.map(&:name)).empty?` would have returned true. This commit ensures it's not the case anymore and adds a test for it. Co-Authored-By: Martin Brennan <mjrbrennan@gmail.com>
This commit is contained in:
@ -330,7 +330,7 @@ module DiscourseAutomation
|
||||
next if categories && !categories.include?(post.topic.category_id)
|
||||
|
||||
tags = fields.dig("tags", "value")
|
||||
next if tags && (tags & post.topic.tags.map(&:name)).empty?
|
||||
next if tags&.any? && (tags & post.topic.tags.map(&:name)).empty?
|
||||
|
||||
DiscourseAutomation::UserGlobalNotice
|
||||
.where(identifier: automation.id)
|
||||
|
Reference in New Issue
Block a user