Opened 7 years ago
Closed 7 years ago
#5513 closed defect (fixed)
Can't delete draft blog posts
Reported by: | ayleph | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 0.10.0 |
Component: | programming | Keywords: | blog, delete |
Cc: | Parent Tickets: |
Description
Draft blog posts are set to the 'failed' state. The generated blogpost_delete_url link for a draft gets routed to a 404 page.
Attachments (1)
Change History (7)
comment:1 by , 7 years ago
by , 7 years ago
Attachment: | 0001-Fix-5513-Can-t-delete-blog-post-drafts.patch added |
---|
comment:2 by , 7 years ago
I've attached a patch which I think addresses this issue. I removed the requirement from @get_media_entry_by_id
for the media to be processed. This allows unprocessed media to be deleted. For all of the other views which used the decorator, I added constraints that the media must be processed.
comment:3 by , 7 years ago
Status: | new → review |
---|
comment:4 by , 7 years ago
Keywords: | delete added |
---|
comment:5 by , 7 years ago
Milestone: | → 0.10.0 |
---|
comment:6 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | review → closed |
I've been using this patch for weeks without issue. Pushed to master in 2f2b4cb.
And here's why. First, the deletion URL is created using the
media_confirm_delete
generator.The
media_confirm_delete
view is decorated by@get_media_entry_by_id
.The
@get_media_entry_by_id
generator returns a 404 for media that aren't in the processed state.Since blog post drafts aren't processed, the delete URL returns a 404.