Private
Public Access
1
0

adding start date to tasks

This commit is contained in:
Sander Roosendaal
2018-07-12 21:34:35 +02:00
parent d19cbb34d4
commit 0e70a43a4e
4 changed files with 35 additions and 6 deletions

View File

@@ -88,6 +88,8 @@ def get_strava_workouts(rower):
res = get_strava_workout_list(rower.user,limit_n=10)
print res.status_code
if (res.status_code != 200):
return 0
else:
@@ -121,7 +123,6 @@ def get_strava_workouts(rower):
newids = [stravaid for stravaid in stravaids if not stravaid in knownstravaids]
for stravaid in newids:
result = create_async_workout(alldata,rower.user,stravaid)
@@ -137,6 +138,11 @@ def create_async_workout(alldata,user,stravaid,debug=False):
except:
workouttype = 'rower'
if workouttype.lower() == 'rowing':
workouttype = 'rower'
if 'summary_polyline' in data['map']:
workouttype = 'water'
if workouttype not in [x[0] for x in Workout.workouttypes]:
workouttype = 'other'
@@ -205,6 +211,7 @@ def create_async_workout(alldata,user,stravaid,debug=False):
stravaid,
starttimeunix,
csvfilename,
workouttype = workouttype,
)
return 1
@@ -402,6 +409,11 @@ def add_workout_from_data(user,importid,data,strokedata,
workouttype = data['type']
except KeyError:
workouttype = 'rower'
if workouttype.lower() == 'rowing':
workouttype = 'rower'
if 'summary_polyline' in data['map']:
workouttype = 'water'
if workouttype not in [x[0] for x in Workout.workouttypes]:
workouttype = 'other'
@@ -593,7 +605,9 @@ def handle_strava_import_stroke_data(title,
stravatoken,
stravaid,
starttimeunix,
csvfilename,debug=True,**kwargs):
csvfilename,debug=True,
workouttype = 'rower',
**kwargs):
# ready to fetch. Hurray
fetchresolution = 'high'
@@ -717,7 +731,11 @@ def handle_strava_import_stroke_data(title,
workoutsbox = Mailbox.objects.filter(name='workouts')[0]
body = 'stravaid {stravaid}'.format(stravaid=stravaid)
body = """stravaid {stravaid}
workouttype {workouttype}""".format(
stravaid=stravaid,
workouttype=workouttype
)
msg = Message(mailbox=workoutsbox,
from_header=useremail,