mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 05:53:52 +08:00
FIX: Pending post deletion by creator (#23130)
`ReviewableQueuedPost` got refactored a while back to use the more appropriate `target_created_by` for the user of the post being queued instead of `created_by`. The change was not extended to the `DELETE /review/:id` endpoint leading to error responses for a user attempting to deleting their own queued post. This fix extends the `Reviewable` lookup implementation in `ReviewablesController#destroy` and Guardian implementation to account for this change.
This commit is contained in:
@ -4389,7 +4389,7 @@ RSpec.describe Guardian do
|
||||
|
||||
context "when attempting to destroy your own reviewable" do
|
||||
it "returns true" do
|
||||
queued_post = Fabricate(:reviewable_queued_post, created_by: user)
|
||||
queued_post = Fabricate(:reviewable_queued_post, target_created_by: user)
|
||||
env =
|
||||
create_request_env(path: "/review/#{queued_post.id}.json").merge(
|
||||
{ "REQUEST_METHOD" => "DELETE" },
|
||||
|
Reference in New Issue
Block a user