Private
Public Access
1
0

import cross training allowed

This commit is contained in:
Sander Roosendaal
2018-02-08 11:29:07 +01:00
parent d785404815
commit 7d51bb9356
4 changed files with 46 additions and 17 deletions

View File

@@ -941,7 +941,7 @@ def add_workout_from_strokedata(user,importid,data,strokedata,
workouttype = 'rower'
if workouttype not in [x[0] for x in Workout.workouttypes]:
workouttype = 'water'
workouttype = 'other'
try:
comments = data['comments']
except:
@@ -1088,7 +1088,7 @@ def add_workout_from_runkeeperdata(user,importid,data):
# To Do - add utcoffset to time
workouttype = data['type']
if workouttype not in [x[0] for x in Workout.workouttypes]:
workouttype = 'water'
workouttype = 'other'
try:
comments = data['notes']
except:
@@ -1261,7 +1261,7 @@ def add_workout_from_runkeeperdata(user,importid,data):
def add_workout_from_stdata(user,importid,data):
workouttype = data['type']
if workouttype not in [x[0] for x in Workout.workouttypes]:
workouttype = 'water'
workouttype = 'other'
try:
comments = data['comments']
except:
@@ -1291,11 +1291,16 @@ def add_workout_from_stdata(user,importid,data):
try:
res = splitstdata(data['distance'])
distance = res[1]
times_distance = res[0]
except KeyError:
return (0,"No distance data in the workout")
try:
res = splitstdata(data['heartrate'])
times_distance = res[0]
distance = 0*times_distance
except KeyError:
return (0,"No distance or heart rate data in the workout")
distance = res[1]
times_distance = res[0]
try:
l = data['location']