added export as ride
This commit is contained in:
@@ -276,7 +276,8 @@ def createstravaworkoutdata(w,dozip=True):
|
||||
|
||||
# Upload the TCX file to Strava and set the workout activity type
|
||||
# to rowing on Strava
|
||||
def handle_stravaexport(f2,workoutname,stravatoken,description=''):
|
||||
def handle_stravaexport(f2,workoutname,stravatoken,description='',
|
||||
activity_type='Rowing'):
|
||||
# w = Workout.objects.get(id=workoutid)
|
||||
client = stravalib.Client(access_token=stravatoken)
|
||||
|
||||
@@ -291,7 +292,7 @@ def handle_stravaexport(f2,workoutname,stravatoken,description=''):
|
||||
|
||||
# description doesn't work yet. Have to wait for stravalib to update
|
||||
if res:
|
||||
act = client.update_activity(res.id,activity_type='Rowing',description=description,device_name='Rowsandall.com')
|
||||
act = client.update_activity(res.id,activity_type=activity_type,description=description,device_name='Rowsandall.com')
|
||||
else:
|
||||
message = 'Strava activity update timed out.'
|
||||
return (0,message)
|
||||
|
||||
Reference in New Issue
Block a user