testing strava
This commit is contained in:
@@ -4518,7 +4518,7 @@ def workout_upload_api(request):
|
|||||||
except NoTokenError:
|
except NoTokenError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if upload_to_strava and stravaid == 0:
|
if upload_to_strava and stravaid == '':
|
||||||
try:
|
try:
|
||||||
message,id = stravastuff.workout_strava_upload(r.user,w)
|
message,id = stravastuff.workout_strava_upload(r.user,w)
|
||||||
except NoTokenError:
|
except NoTokenError:
|
||||||
@@ -4554,8 +4554,14 @@ def workout_upload_api(request):
|
|||||||
message = form.errors
|
message = form.errors
|
||||||
return JSONResponse(status=400,data=message)
|
return JSONResponse(status=400,data=message)
|
||||||
|
|
||||||
|
message = {'status': 'true','id':w.id}
|
||||||
|
statuscode = 200
|
||||||
if fstr:
|
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:
|
if r.getemailnotifications and not r.emailbounced:
|
||||||
link = settings.SITE_URL+reverse(
|
link = settings.SITE_URL+reverse(
|
||||||
@@ -4565,8 +4571,8 @@ def workout_upload_api(request):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
email_sent = send_confirm(r.user, t, link, '')
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user