FIX: Show the envelope icon when the flagged post is a PM. Flagged PM must be exclusively reviewed by admins (#9232)
This commit is contained in:
parent
226d81fcc5
commit
080960a15e
|
@ -1,6 +1,6 @@
|
|||
<div class='post-topic'>
|
||||
{{#if reviewable.topic}}
|
||||
{{topic-status topic=reviewable.topic}}
|
||||
{{topic-status topic=reviewable.topic showPrivateMessageIcon=true}}
|
||||
<a href={{reviewable.target_url}} class='title-text'>{{reviewable.topic.title}}</a>
|
||||
{{category-badge reviewable.category}}
|
||||
{{reviewable-tags tags=reviewable.topic_tags tagName=''}}
|
||||
|
|
|
@ -133,7 +133,7 @@ class Reviewable < ActiveRecord::Base
|
|||
target: target,
|
||||
topic: topic,
|
||||
created_by: created_by,
|
||||
reviewable_by_moderator: reviewable_by_moderator,
|
||||
reviewable_by_moderator: reviewable_by_moderator && !(topic&.private_message?),
|
||||
payload: payload,
|
||||
potential_spam: potential_spam
|
||||
)
|
||||
|
|
|
@ -78,6 +78,17 @@ 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
|
||||
|
|
Loading…
Reference in New Issue