From 697c74c2de0cc940b45014f9becdfa55f961d193 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Tue, 26 Feb 2013 13:54:19 -0600 Subject: [PATCH] Replacing several request.matchdict['media'] -> media_slug ... shorter! Thanks for pointing this out, Elrond ;) This commit sponsored by Gerardo Joven Valdivia. Thank you! --- mediagoblin/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/decorators.py b/mediagoblin/decorators.py index 14b4f8fc..b6f6f909 100644 --- a/mediagoblin/decorators.py +++ b/mediagoblin/decorators.py @@ -130,7 +130,7 @@ def get_user_media_entry(controller): # might not be a slug, might be an id, but whatever media_slug = request.matchdict['media'] - if u":" in request.matchdict['media']: + if u":" in media_slug: # okay, it's not actually a slug, it's some kind of identifier, # probably id: if media_slug.startswith(u'id:'): @@ -144,7 +144,7 @@ def get_user_media_entry(controller): else: # no magical id: stuff? It's a slug! media = MediaEntry.query.filter_by( - slug=request.matchdict['media'], + slug=media_slug, state=u'processed', uploader=user.id).first() -- 2.25.1