Merge branch 'release/v13.23'
This commit is contained in:
3
garminlog.log
Normal file
3
garminlog.log
Normal file
File diff suppressed because one or more lines are too long
@@ -180,10 +180,8 @@ def garmin_workouts_from_details(activities):
|
||||
try:
|
||||
garmintoken = activity['userAccessToken']
|
||||
except KeyError:
|
||||
print(activity)
|
||||
return 0
|
||||
except TypeError:
|
||||
print(activity)
|
||||
return 0
|
||||
try:
|
||||
r = Rower.objects.get(garmintoken=garmintoken)
|
||||
|
||||
@@ -1049,6 +1049,14 @@ def garmin_details_view(request):
|
||||
if request.method != 'POST':
|
||||
return HttpResponse(status=200)
|
||||
|
||||
t = time.localtime()
|
||||
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
||||
with open('garminlog.log','a') as f:
|
||||
f.write('\n')
|
||||
f.write(timestamp)
|
||||
f.write(' ')
|
||||
f.write(str(request.body))
|
||||
|
||||
# POST request
|
||||
data = json.loads(request.body)
|
||||
result = garmin_stuff.garmin_workouts_from_details(data)
|
||||
|
||||
Reference in New Issue
Block a user