delete_media_files() might as well use itervalues (thx Elrond)
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 4 Sep 2011 23:24:04 +0000 (18:24 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 4 Sep 2011 23:24:04 +0000 (18:24 -0500)
mediagoblin/util.py

index e391b8b0b1eaeaa6cea6d6289a962d637f1814fd..410b1c9aa48fe89a41fa2c8a435dc1a277b011cd 100644 (file)
@@ -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)