From a8eae5911dcbc16297d5cfda82e0b097c6657d2b Mon Sep 17 00:00:00 2001
From: Sander Roosendaal
Select Files with the File button or drag them on the marked area
+Select Files with the File button or drag them on the marked area
@@ -141,7 +141,7 @@ $('#id_offline').prop('checked','True'); data.set($('#id_offline').attr('name'),$('#id_offline').prop('checked')); console.log("Set offline to True"); - $('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.'); + $('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done.'); $('#extra_message').addClass('message'); } } @@ -240,7 +240,7 @@ $('#id_offline').prop('checked','True'); data.set($('#id_offline').attr('name'),$('#id_offline').prop('checked')); console.log("Set offline to True"); - $('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done. The extra actions will not be performed.'); + $('#extra_message').text('Because of the large size, we recommend to use background processing. You will receive email when it is done.'); $('#extra_message').addClass('message'); } data.set("file",f); diff --git a/rowers/uploads.py b/rowers/uploads.py index a7bd5622..8dab7755 100644 --- a/rowers/uploads.py +++ b/rowers/uploads.py @@ -191,6 +191,8 @@ def upload_options(body): body = cleanbody(body) try: yml = (yaml.load(body)) + if 'fromuploadform' in yml: + return yml try: for key, value in yml.iteritems(): lowkey = key.lower() diff --git a/rowers/views.py b/rowers/views.py index bfa49541..619a99db 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -8,6 +8,7 @@ import pytz import operator import warnings import urllib +import yaml from PIL import Image from numbers import Number from django.views.generic.base import TemplateView @@ -8551,9 +8552,14 @@ def workout_upload_view(request, ) else: workoutsbox = Mailbox.objects.filter(name='workouts')[0] + uploadoptions['fromuploadform'] = True + bodyyaml = yaml.safe_dump( + uploadoptions, + default_flow_style=False + ) msg = Message(mailbox=workoutsbox, from_header=r.user.email, - subject = t) + subject = t,body=bodyyaml) msg.save() f3 = 'media/mailbox_attachments/'+f2[6:] copyfile(f2,f3)