Private
Public Access
1
0

replacing keyword async with harmless alternative

This commit is contained in:
Sander Roosendaal
2020-03-02 09:18:34 +01:00
parent 936c4cf175
commit ac66ad6341
4 changed files with 8 additions and 8 deletions

View File

@@ -439,14 +439,14 @@ 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='',
activity_type='Rowing',async=False):
activity_type='Rowing',quick=False):
# w = Workout.objects.get(id=workoutid)
client = stravalib.Client(access_token=stravatoken)
act = client.upload_activity(f2,'tcx.gz',name=workoutname)
try:
if async:
if quick:
res = act.wait(poll_interval=1.0, timeout=10)
message = 'Workout successfully synchronized to Strava'
else:
@@ -625,7 +625,7 @@ def add_workout_from_data(user,importid,data,strokedata,
return id,message
def workout_strava_upload(user,w, async=False):
def workout_strava_upload(user,w, quick=False):
try:
thetoken = strava_open(user)
except NoTokenError:
@@ -648,7 +648,7 @@ def workout_strava_upload(user,w, async=False):
f,w.name,
r.stravatoken,
description=w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
activity_type=r.stravaexportas,async=async)
activity_type=r.stravaexportas,quick=quick)
if res==0:
message = mes
w.uploadedtostrava = -1