FIX: properly unassign topics if there are no **more** flags to handle
This commit is contained in:
parent
7c8ce7d1b3
commit
5800f768f5
|
@ -217,7 +217,8 @@ after_initialize do
|
||||||
on(:flag_reviewed) do |post|
|
on(:flag_reviewed) do |post|
|
||||||
if SiteSetting.assign_locks_flags? &&
|
if SiteSetting.assign_locks_flags? &&
|
||||||
post.topic &&
|
post.topic &&
|
||||||
FlagQuery.flagged_post_actions(topic_id: post.topic.id).count == 0
|
FlagQuery.flagged_post_actions(topic_id: post.topic_id, filter: "old").count > 0 &&
|
||||||
|
FlagQuery.flagged_post_actions(topic_id: post.topic_id).count == 0
|
||||||
|
|
||||||
assigner = ::TopicAssigner.new(post.topic, Discourse.system_user)
|
assigner = ::TopicAssigner.new(post.topic, Discourse.system_user)
|
||||||
assigner.unassign
|
assigner.unassign
|
||||||
|
|
Loading…
Reference in New Issue