From: Christopher Allan Webber Date: Sun, 4 Sep 2011 23:24:04 +0000 (-0500) Subject: delete_media_files() might as well use itervalues (thx Elrond) X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63e7abdf0f7696bca7695f23694b1cfdeb88bd73;p=mediagoblin.git delete_media_files() might as well use itervalues (thx Elrond) --- diff --git a/mediagoblin/util.py b/mediagoblin/util.py index e391b8b0..410b1c9a 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -349,7 +349,12 @@ def get_locale_from_request(request): Figure out what target language is most appropriate based on the request """ - request_form = request.GET or request.POST + if request.method == 'GET': + request_form = request.GET + else: + import pdb + pdb.set_trace() + request_form = request.POST if request_form.has_key('lang'): return locale_to_lower_upper(request_form['lang']) @@ -689,7 +694,7 @@ def delete_media_files(media): Arguments: - media: A MediaEntry document """ - for handle, listpath in media['media_files'].items(): + for listpath in media['media_files'].itervalues(): mg_globals.public_store.delete_file( listpath)