From 0b95003cd4055745494cf10c89ccbfa6ac04c0e4 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Sun, 30 Jun 2013 20:51:23 -0700 Subject: [PATCH] use media.get_uploader and fix typo --- mediagoblin/submit/views.py | 2 +- mediagoblin/user_pages/views.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 3b853697..7f7dee33 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -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)) diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py index 3b411fe0..5eac0fe4 100644 --- a/mediagoblin/user_pages/views.py +++ b/mediagoblin/user_pages/views.py @@ -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() -- 2.25.1