mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
FIX: make staff_edit_locks_post work with download_remote_images_to_local
This commit is contained in:
parent
125bb46052
commit
6121d11187
@ -176,6 +176,7 @@ class PostRevisor
|
|||||||
!@post.wiki? &&
|
!@post.wiki? &&
|
||||||
@fields.has_key?('raw') &&
|
@fields.has_key?('raw') &&
|
||||||
@editor.staff? &&
|
@editor.staff? &&
|
||||||
|
@editor != Discourse.system_user &&
|
||||||
!@post.user.staff?
|
!@post.user.staff?
|
||||||
)
|
)
|
||||||
PostLocker.new(@post, @editor).lock
|
PostLocker.new(@post, @editor).lock
|
||||||
|
@ -546,7 +546,7 @@ describe PostRevisor do
|
|||||||
expect(post).to be_locked
|
expect(post).to be_locked
|
||||||
end
|
end
|
||||||
|
|
||||||
it "doesn't wiki posts" do
|
it "doesn't lock the wiki posts" do
|
||||||
post.wiki = true
|
post.wiki = true
|
||||||
result = subject.revise!(
|
result = subject.revise!(
|
||||||
moderator,
|
moderator,
|
||||||
@ -556,6 +556,7 @@ describe PostRevisor do
|
|||||||
post.reload
|
post.reload
|
||||||
expect(post).not_to be_locked
|
expect(post).not_to be_locked
|
||||||
end
|
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,
|
||||||
@ -577,6 +578,16 @@ describe PostRevisor do
|
|||||||
expect(post).not_to be_locked
|
expect(post).not_to be_locked
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "doesn't lock the post when revised by system user" do
|
||||||
|
result = subject.revise!(
|
||||||
|
Discourse.system_user,
|
||||||
|
raw: "I usually replace hotlinked images"
|
||||||
|
)
|
||||||
|
expect(result).to eq(true)
|
||||||
|
post.reload
|
||||||
|
expect(post).not_to be_locked
|
||||||
|
end
|
||||||
|
|
||||||
it "doesn't lock a staff member's post" do
|
it "doesn't lock a staff member's post" do
|
||||||
staff_post = Fabricate(:post, user: moderator)
|
staff_post = Fabricate(:post, user: moderator)
|
||||||
revisor = PostRevisor.new(staff_post)
|
revisor = PostRevisor.new(staff_post)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user