use media.get_uploader and fix typo
authorRodney Ewing <ewing.rj@gmail.com>
Mon, 1 Jul 2013 03:51:23 +0000 (20:51 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Mon, 26 Aug 2013 13:33:30 +0000 (06:33 -0700)
mediagoblin/submit/views.py
mediagoblin/user_pages/views.py

index 3b853697c2db1a0397a85d04fa2e1a1a541076a3..7f7dee330f894389b6e86f3cb4d2a305c24d4470 100644 (file)
@@ -106,7 +106,7 @@ def submit_start(request):
                 with queue_file:
                     queue_file.write(request.files['file'].stream.read())
 
-                # Get file size an round to 2 decimal places
+                # Get file size and round to 2 decimal places
                 file_size = request.app.queue_store.get_file_size(
                     entry.queued_media_file) / (1024.0 * 1024)
                 file_size = float('{0:.2f}'.format(file_size))
index 3b411fe049714db45eac4006847bdabd79666220..5eac0fe4dd036eff2c65c3180354d0f0579d634d 100644 (file)
@@ -297,8 +297,9 @@ def media_confirm_delete(request, media):
         if form.confirm.data is True:
             username = media.get_uploader.username
 
-            request.user.uploaded = request.user.uploaded - media.file_size
-            request.user.save()
+            media.get_uploader.uploaded = media.get_uploader.uploaded - \
+                media.file_size
+            media.get_uploader.save()
 
             # Delete MediaEntry and all related files, comments etc.
             media.delete()