mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: Take action should agree with all pending flags
This commit is contained in:
@ -89,6 +89,12 @@ class PostActionCreator
|
||||
PostActionNotifier.post_action_created(post_action)
|
||||
notify_subscribers
|
||||
|
||||
# agree with other flags
|
||||
if @take_action && reviewable = @post.reviewable_flag
|
||||
result.reviewable.perform(@created_by, :agree_and_keep)
|
||||
post_action.try(:update_counters)
|
||||
end
|
||||
|
||||
result.success = true
|
||||
result.post_action = post_action
|
||||
|
||||
@ -211,12 +217,6 @@ private
|
||||
|
||||
GivenDailyLike.increment_for(@created_by.id) if @post_action_type_id == PostActionType.types[:like]
|
||||
|
||||
# agree with other flags
|
||||
if @take_action && reviewable = @post.reviewable_flag
|
||||
reviewable.perform(@created_by, :agree_and_keep)
|
||||
post_action.try(:update_counters)
|
||||
end
|
||||
|
||||
post_action
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
# can happen despite being .create
|
||||
|
Reference in New Issue
Block a user