aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-09-04 18:24:04 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-09-04 18:24:04 -0500
commit63e7abdf0f7696bca7695f23694b1cfdeb88bd73 (patch)
tree6aba236458fca7219e99da9786959d6045d6bc53
parent7084661d5b6fb8db0446c3868198ad60eae5e786 (diff)
downloadmediagoblin-63e7abdf0f7696bca7695f23694b1cfdeb88bd73.tar.lz
mediagoblin-63e7abdf0f7696bca7695f23694b1cfdeb88bd73.tar.xz
mediagoblin-63e7abdf0f7696bca7695f23694b1cfdeb88bd73.zip
delete_media_files() might as well use itervalues (thx Elrond)
-rw-r--r--mediagoblin/util.py9
1 files 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)