mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 17:34:39 +08:00
FIX: Don't lock wiki posts when they're edited
This commit is contained in:
@ -169,6 +169,7 @@ class PostRevisor
|
|||||||
# Lock the post by default if the appropriate setting is true
|
# Lock the post by default if the appropriate setting is true
|
||||||
if (
|
if (
|
||||||
SiteSetting.staff_edit_locks_post? &&
|
SiteSetting.staff_edit_locks_post? &&
|
||||||
|
!@post.wiki? &&
|
||||||
@fields.has_key?('raw') &&
|
@fields.has_key?('raw') &&
|
||||||
@editor.staff? &&
|
@editor.staff? &&
|
||||||
!@post.user.staff?
|
!@post.user.staff?
|
||||||
|
@ -452,6 +452,16 @@ describe PostRevisor do
|
|||||||
expect(post).to be_locked
|
expect(post).to be_locked
|
||||||
end
|
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
|
it "doesn't lock the post when the raw did not change" do
|
||||||
result = subject.revise!(
|
result = subject.revise!(
|
||||||
moderator,
|
moderator,
|
||||||
|
Reference in New Issue
Block a user