Skip to content

Commit

Permalink
FIX: Akismet reviewables shouldn't recalculate their score. (#20)
Browse files Browse the repository at this point in the history
Related to discourse/discourse#13009. These reviewables are never re-flagged, so "recalculate_score" is not necessary.
  • Loading branch information
romanrizzi committed May 10, 2021
1 parent 79ade58 commit fa4d0da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions models/reviewable_akismet_post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def perform_confirm_delete(performed_by, _args)
UserDestroyer.new(performed_by).destroy(target_created_by, user_deletion_opts(performed_by))
end

successful_transition :deleted, :agreed, recalculate_score: false
successful_transition :deleted, :agreed
end

private
Expand All @@ -82,9 +82,8 @@ def bouncer
DiscourseAkismet::PostsBouncer.new
end

def successful_transition(to_state, update_flag_status, recalculate_score: true)
def successful_transition(to_state, update_flag_status)
create_result(:success, to_state) do |result|
result.recalculate_score = recalculate_score
result.update_flag_stats = { status: update_flag_status, user_ids: [created_by_id] }
end
end
Expand Down
5 changes: 2 additions & 3 deletions models/reviewable_akismet_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def perform_reject_spam_user_delete(performed_by, _args)
UserDestroyer.new(performed_by).destroy(target, user_deletion_opts(performed_by))
end

successful_transition :deleted, :agreed, recalculate_score: false
successful_transition :deleted, :agreed
end

private
Expand All @@ -47,9 +47,8 @@ def bouncer
DiscourseAkismet::UsersBouncer.new
end

def successful_transition(to_state, update_flag_status, recalculate_score: true)
def successful_transition(to_state, update_flag_status)
create_result(:success, to_state) do |result|
result.recalculate_score = recalculate_score
result.update_flag_stats = { status: update_flag_status, user_ids: [created_by_id] }
end
end
Expand Down

0 comments on commit fa4d0da

Please sign in to comment.