Private
Public Access
1
0

replaced async with non keyword equivalent

This commit is contained in:
Sander Roosendaal
2020-03-10 06:18:45 +01:00
parent 050db5b560
commit 3d6f8e89cb
2 changed files with 3 additions and 3 deletions

View File

@@ -859,7 +859,7 @@ def default(o):
raise TypeError raise TypeError
# Uploading workout # Uploading workout
def workout_c2_upload(user,w,async=False): def workout_c2_upload(user,w,asynchron=False):
message = 'trying C2 upload' message = 'trying C2 upload'
try: try:
if mytypes.c2mapping[w.workouttype] is None: if mytypes.c2mapping[w.workouttype] is None:
@@ -888,7 +888,7 @@ def workout_c2_upload(user,w,async=False):
'Content-Type': 'application/json'} 'Content-Type': 'application/json'}
import urllib import urllib
url = "https://log.concept2.com/api/users/%s/results" % (c2userid) url = "https://log.concept2.com/api/users/%s/results" % (c2userid)
if not async: if not asynchron:
response = requests.post(url,headers=headers,data=json.dumps(data,default=default)) response = requests.post(url,headers=headers,data=json.dumps(data,default=default))

View File

@@ -525,7 +525,7 @@ def do_sync(w,options, quick=False):
if ('upload_to_C2' in options and options['upload_to_C2']) or (w.user.c2_auto_export and ispromember(w.user.user)): if ('upload_to_C2' in options and options['upload_to_C2']) or (w.user.c2_auto_export and ispromember(w.user.user)):
try: try:
message,id = c2stuff.workout_c2_upload(w.user.user,w,async=True) message,id = c2stuff.workout_c2_upload(w.user.user,w,asynchron=True)
except NoTokenError: except NoTokenError:
id = 0 id = 0
message = "Something went wrong with the Concept2 sync" message = "Something went wrong with the Concept2 sync"