adding more debugging
This commit is contained in:
@@ -4392,7 +4392,7 @@ def workout_toggle_ranking(request,id=0):
|
|||||||
# simple POST API for files on local (e.g. in mailbox)
|
# simple POST API for files on local (e.g. in mailbox)
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
def workout_upload_api(request):
|
def workout_upload_api(request):
|
||||||
stravaid = 0
|
stravaid = ''
|
||||||
if request.method != 'POST':
|
if request.method != 'POST':
|
||||||
message = {'status':'false','message':'this view cannot be accessed through GET'}
|
message = {'status':'false','message':'this view cannot be accessed through GET'}
|
||||||
return JSONResponse(status=403,data=message)
|
return JSONResponse(status=403,data=message)
|
||||||
@@ -4445,7 +4445,7 @@ def workout_upload_api(request):
|
|||||||
try:
|
try:
|
||||||
stravaid = post_data['stravaid']
|
stravaid = post_data['stravaid']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
stravaid = 0
|
stravaid = ''
|
||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
t = form.cleaned_data['title']
|
t = form.cleaned_data['title']
|
||||||
@@ -4497,8 +4497,10 @@ def workout_upload_api(request):
|
|||||||
return JSONResponse(status=400,data=message)
|
return JSONResponse(status=400,data=message)
|
||||||
|
|
||||||
w = Workout.objects.get(id=id)
|
w = Workout.objects.get(id=id)
|
||||||
if stravaid != 0:
|
if stravaid:
|
||||||
|
print('setting Strava id',stravaid)
|
||||||
w.uploadedtostrava = stravaid
|
w.uploadedtostrava = stravaid
|
||||||
|
print(w,w.id,w.user)
|
||||||
w.save()
|
w.save()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user