FIX: Don't lock wiki posts when they're edited
This commit is contained in:
parent
0f66a99eb2
commit
17a615165c
|
@ -169,6 +169,7 @@ class PostRevisor
|
|||
# Lock the post by default if the appropriate setting is true
|
||||
if (
|
||||
SiteSetting.staff_edit_locks_post? &&
|
||||
!@post.wiki? &&
|
||||
@fields.has_key?('raw') &&
|
||||
@editor.staff? &&
|
||||
!@post.user.staff?
|
||||
|
|
|
@ -452,6 +452,16 @@ describe PostRevisor do
|
|||
expect(post).to be_locked
|
||||
end
|
||||
|
||||
it "doesn't wiki posts" do
|
||||
post.wiki = true
|
||||
result = subject.revise!(
|
||||
moderator,
|
||||
raw: "some new raw content"
|
||||
)
|
||||
expect(result).to eq(true)
|
||||
post.reload
|
||||
expect(post).not_to be_locked
|
||||
end
|
||||
it "doesn't lock the post when the raw did not change" do
|
||||
result = subject.revise!(
|
||||
moderator,
|
||||
|
|
Loading…
Reference in New Issue