FIX: don't 'return' in 'flag_reviewed' block
This commit is contained in:
parent
4b7a99f017
commit
615ad7c5c3
10
plugin.rb
10
plugin.rb
|
@ -262,15 +262,13 @@ after_initialize do
|
|||
|
||||
# Unassign if there are no more flags in the topic
|
||||
on(:flag_reviewed) do |post|
|
||||
return if reviewable_api_enabled
|
||||
|
||||
if SiteSetting.assign_locks_flags? &&
|
||||
if !reviewable_api_enabled &&
|
||||
SiteSetting.assign_locks_flags? &&
|
||||
post.topic &&
|
||||
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.unassign
|
||||
|
||||
::TopicAssigner.new(post.topic, Discourse.system_user).unassign
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue