Private
Public Access
1
0

bug fixes

This commit is contained in:
Sander Roosendaal
2020-02-18 21:37:13 +01:00
parent fc6dd7e347
commit 38094d7b13
6 changed files with 35 additions and 33 deletions

View File

@@ -15,6 +15,7 @@ from rowingdata import rowingdata as rrdata
from rowingdata import rower as rrower
import yaml
import shutil
from shutil import copyfile
@@ -1469,7 +1470,8 @@ def new_workout_from_file(r, f2,
title='Workout',
boattype='1x',
makeprivate=False,
notes=''):
notes='',
uploadoptions={'boattype':'1x','workouttype':'rower'}):
message = ""
impeller = False
try:
@@ -1483,12 +1485,14 @@ def new_workout_from_file(r, f2,
oarlength = 2.89
inboard = 0.88
if len(fileformat) == 3 and fileformat[0] == 'zip':
uploadoptions['fromuploadform'] = True
bodyyaml = yaml.safe_dump(uploadoptions,default_flow_style=False)
f_to_be_deleted = f2
impeller = False
workoutsbox = Mailbox.objects.filter(name='workouts')[0]
msg = Message(mailbox=workoutsbox,
from_header=r.user.email,
subject = title)
subject = title,body=bodyyaml)
msg.save()
f3 = 'media/mailbox_attachments/'+f2[6:]
copyfile(f2,f3)