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))
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()