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