FIX: Use a proper event for removing assign on close
This commit is contained in:
parent
e7ca1ffbf7
commit
626965f94c
|
@ -44,12 +44,6 @@ SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.auto_assign(post, force: false)
|
def self.auto_assign(post, force: false)
|
||||||
|
|
||||||
if SiteSetting.unassign_on_close && post.topic && post.topic.closed
|
|
||||||
assigner = new(post.topic, Discourse.system_user)
|
|
||||||
assigner.unassign(silent: true)
|
|
||||||
end
|
|
||||||
|
|
||||||
return unless SiteSetting.assigns_by_staff_mention
|
return unless SiteSetting.assigns_by_staff_mention
|
||||||
|
|
||||||
if post.user && post.topic && post.user.staff?
|
if post.user && post.topic && post.user.staff?
|
||||||
|
|
|
@ -174,6 +174,13 @@ after_initialize do
|
||||||
::TopicAssigner.auto_assign(post, force: true)
|
::TopicAssigner.auto_assign(post, force: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
on(:topic_closed) do |topic|
|
||||||
|
if SiteSetting.unassign_on_close
|
||||||
|
assigner = ::TopicAssigner.new(topic, Discourse.system_user)
|
||||||
|
assigner.unassign(silent: true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
on(:move_to_inbox) do |info|
|
on(:move_to_inbox) do |info|
|
||||||
if SiteSetting.unassign_on_group_archive && info[:group]
|
if SiteSetting.unassign_on_group_archive && info[:group]
|
||||||
if topic = info[:topic]
|
if topic = info[:topic]
|
||||||
|
|
Loading…
Reference in New Issue