From: Aditi Date: Fri, 9 Aug 2013 09:35:20 +0000 (+0530) Subject: Add delete error for failed type. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=97ce2563ed4fd4fa68a5d1e3db802e0d41d48a29;p=mediagoblin.git Add delete error for failed type. --- diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index e5930826..bac433ea 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -275,12 +275,16 @@ def media_collect(request, media): @require_active_login def media_confirm_delete(request): - allowed_state = [u'processed', u'failed'] + allowed_state = [u'failed', u'processed'] + media = None for media_state in allowed_state: media = request.db.MediaEntry.query.filter_by(id=request.matchdict['media_id'], state=media_state).first() + if media: + break + if not media: return render_404(request) - + given_username = request.matchdict.get('user') if given_username and (given_username != media.get_uploader.username): return render_404(request)