FIX: Make post notices invisible to poster.
This commit is contained in:
parent
b28b418363
commit
ceec11a153
|
@ -370,7 +370,7 @@ class PostSerializer < BasicPostSerializer
|
|||
end
|
||||
|
||||
def include_post_notice_type?
|
||||
return false if scope.user&.id != object.user_id && !scope.user&.has_trust_level?(TrustLevel[2])
|
||||
return false if scope.user&.id == object.user_id || !scope.user&.has_trust_level?(TrustLevel[2])
|
||||
|
||||
post_notice_type.present?
|
||||
end
|
||||
|
|
|
@ -193,7 +193,7 @@ describe PostSerializer do
|
|||
|
||||
it "will not show for poster and TL2+ users" do
|
||||
expect(json_for_user(nil)[:post_notice_type]).to eq(nil)
|
||||
expect(json_for_user(user)[:post_notice_type]).to eq("returning")
|
||||
expect(json_for_user(user)[:post_notice_type]).to eq(nil)
|
||||
expect(json_for_user(user_tl1)[:post_notice_type]).to eq(nil)
|
||||
expect(json_for_user(user_tl2)[:post_notice_type]).to eq("returning")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue