Private
Public Access
1
0

testing strava

This commit is contained in:
Sander Roosendaal
2020-02-18 22:21:58 +01:00
parent 38094d7b13
commit 288b849df3

View File

@@ -4518,7 +4518,7 @@ def workout_upload_api(request):
except NoTokenError:
pass
if upload_to_strava and stravaid == 0:
if upload_to_strava and stravaid == '':
try:
message,id = stravastuff.workout_strava_upload(r.user,w)
except NoTokenError:
@@ -4554,8 +4554,14 @@ def workout_upload_api(request):
message = form.errors
return JSONResponse(status=400,data=message)
message = {'status': 'true','id':w.id}
statuscode = 200
if fstr:
os.remove(fstr)
try:
os.remove(fstr)
except FileNotFoundError:
message = {'status': 'true', 'id':w.id,'message': 'Error deleting temporary file'}
statuscode = 500
if r.getemailnotifications and not r.emailbounced:
link = settings.SITE_URL+reverse(
@@ -4565,8 +4571,8 @@ def workout_upload_api(request):
}
)
email_sent = send_confirm(r.user, t, link, '')
message = {'status': 'true','id':w.id}
return JSONResponse(status=200,data=message)
return JSONResponse(status=statuscode,data=message)