mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] Patch: Don't return 404 when trying to delete unprocessed me


From: ayleph
Subject: [GMG-Devel] Patch: Don't return 404 when trying to delete unprocessed media
Date: Tue, 27 Jun 2017 23:01:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

A user on my instance told me he got a 404 when trying to delete draft
blog posts. I investigated and found out this is because our
confirm_media_delete view uses the @get_media_entry_by_id decorator
which returns a 404 if the media isn't processed. Draft blog posts
aren't given the processed state; this is intentional so that drafts
don't show up when someone is browsing that user's media. However, this
means that they can't currently be deleted either, unless you publish
then delete.

I've created a ticket for this issue and uploaded a patch [1]. In my
solution, I've modified @get_media_entry_by_id to return media
regardless of the processing state, and then I put appropriate
conditions on the views to return 404 when the media isn't processed.
This lets me require that the media be processed selectively, so that I
can still allow deleting unprocessed media. This also means that we
could add a button to the user media processing panel to allow them to
delete failed uploads. I think that would be a great thing to add.

I think this is a suitable workaround, but I don't feel confident enough
to push the change without someone else giving some feedback. There may
be a better way to do this.

[1] https://issues.mediagoblin.org/ticket/5513

-- 
ayleph


reply via email to

[Prev in Thread] Current Thread [Next in Thread]