FIX: Moderators should be able to review flagged PMs since this has always been like this

This commit is contained in:
romanrizzi 2020-03-20 12:28:09 -03:00
parent 20f3be1e9c
commit cfec10a568
2 changed files with 1 additions and 12 deletions

View File

@ -133,7 +133,7 @@ class Reviewable < ActiveRecord::Base
target: target,
topic: topic,
created_by: created_by,
reviewable_by_moderator: reviewable_by_moderator && !(topic&.private_message?),
reviewable_by_moderator: reviewable_by_moderator,
payload: payload,
potential_spam: potential_spam
)

View File

@ -78,17 +78,6 @@ RSpec.describe Reviewable, type: :model do
expect(r1.pending?).to eq(true)
expect(r0.pending?).to eq(false)
end
it 'sets the reviewable_by_moderator attribute to false when the topic is a PM' do
pm_topic = Fabricate(:private_message_topic)
post = Fabricate(:post, topic: pm_topic)
reviewable = ReviewableFlaggedPost.needs_review!(
target: post, topic: pm_topic,
created_by: Discourse.system_user, reviewable_by_moderator: true
)
expect(reviewable.reviewable_by_moderator).to eq(false)
end
end
context ".list_for" do