aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/decorators.py
diff options
context:
space:
mode:
authorayleph <ayleph@thisshitistemp.com>2017-06-27 22:45:42 -0700
committerAndrew Browning <ayleph@thisshitistemp.com>2017-08-15 01:43:58 -0400
commit2f2b4cbacb72cbeb21d51323296fb90a20c81737 (patch)
treefc5ff942c00542f54ab01ec099a992ef6e011896 /mediagoblin/decorators.py
parent1f8c877d7430c1101740ef6ee732e90ff4c9cfdc (diff)
downloadmediagoblin-2f2b4cbacb72cbeb21d51323296fb90a20c81737.tar.lz
mediagoblin-2f2b4cbacb72cbeb21d51323296fb90a20c81737.tar.xz
mediagoblin-2f2b4cbacb72cbeb21d51323296fb90a20c81737.zip
Fix #5513 - Can't delete blog post drafts
Modify the @get_media_entry_by_id decorator to return media regardless of processing state. Separately modify all view functions that use the @get_media_entry_by_id decorator to require that the media be in the processed state, other than for the media_confirm_delete view. This allows blog post drafts to be deleted without returning a 404. Further, it adds the ability to delete unprocessed media in the future, which would be a nice addition to the user processing panel.
Diffstat (limited to 'mediagoblin/decorators.py')
-rw-r--r--mediagoblin/decorators.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mediagoblin/decorators.py b/mediagoblin/decorators.py
index daeddb3f..2b8343b8 100644
--- a/mediagoblin/decorators.py
+++ b/mediagoblin/decorators.py
@@ -268,8 +268,7 @@ def get_media_entry_by_id(controller):
@wraps(controller)
def wrapper(request, *args, **kwargs):
media = MediaEntry.query.filter_by(
- id=request.matchdict['media_id'],
- state=u'processed').first()
+ id=request.matchdict['media_id']).first()
# Still no media? Okay, 404.
if not media:
return render_404(request)