A platform for community discussion. Free, open, simple.
FIX: make staff_edit_locks_post work with download_remote_images_to_local
Maja Komel6121d1118793
diff --git a/lib/post_revisor.rb b/lib/post_revisor.rbindex 4a37236018b..90a5c2f2980 100644--- a/lib/post_revisor.rb+++ b/lib/post_revisor.rb@@ -176,6 +176,7 @@ class PostRevisor@fields.has_key?('raw') &&@editor.staff? &&+ @editor != Discourse.system_user &&)PostLocker.new(@post, @editor).lockdiff --git a/spec/components/post_revisor_spec.rb b/spec/components/post_revisor_spec.rbindex eb843010f06..4f5df63762b 100644--- a/spec/components/post_revisor_spec.rb+++ b/spec/components/post_revisor_spec.rb@@ -546,7 +546,7 @@ describe PostRevisor doexpect(post).to be_lockedend- it "doesn't wiki posts" do+ it "doesn't lock the wiki posts" dopost.wiki = trueresult = subject.revise!(moderator,@@ -556,6 +556,7 @@ describe PostRevisor dopost.reloadexpect(post).not_to be_lockedend+it "doesn't lock the post when the raw did not change" doresult = subject.revise!(moderator,@@ -577,6 +578,16 @@ describe PostRevisor doexpect(post).not_to be_lockedend+ 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" dostaff_post = Fabricate(:post, user: moderator)revisor = PostRevisor.new(staff_post)