From 63e7abdf0f7696bca7695f23694b1cfdeb88bd73 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 4 Sep 2011 18:24:04 -0500 Subject: [PATCH] delete_media_files() might as well use itervalues (thx Elrond) --- mediagoblin/util.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.25.1