Private
Public Access
1
0

Seems to work (golang routine to test)

This commit is contained in:
Sander Roosendaal
2020-07-08 22:04:27 +02:00
parent 30b9fac1d5
commit ea2af4830c
5 changed files with 37 additions and 14 deletions

View File

@@ -1050,11 +1050,11 @@ def garmin_newfiles_ping(request):
try:
garmintoken = file['userAccessToken']
try:
r = Rower.objects.get(garmintoken=garmintoken
)
r = Rower.objects.get(garmintoken=garmintoken)
callbackURL = file['callbackURL']
starttime = file['startTimeInSeconds']
job = get_garmin_file(r,callbackURL,starttime)
fileType = file['fileType']
job = garmin_stuff.get_garmin_file(r,callbackURL,starttime,fileType)
except Rower.DoesNotExist:
pass
except KeyError:

View File

@@ -4624,6 +4624,7 @@ def workout_upload_api(request):
q = request.POST
post_data = {k: q.getlist(k) if len(q.getlist(k))>1 else v for k, v in q.items()}
# only allow local host
hostt = request.get_host().split(':')
if hostt[0] not in ['localhost','127.0.0.1','dev.rowsandall.com','rowsandall.com']:
@@ -4716,6 +4717,7 @@ def workout_upload_api(request):
message = {'status':'false','message':'unable to process file: '+message}
else:
message = {'status': 'false', 'message': 'unable to process file'}
print(message)
return JSONResponse(status=400,data=message)
if id == -1:
message = {'status': 'true', 'message':message}