more logging on strava
This commit is contained in:
@@ -2760,7 +2760,11 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
|
|||||||
f.write('Response json {json}\n'.format(json=response.json()))
|
f.write('Response json {json}\n'.format(json=response.json()))
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
workoutsummary = requests.get(url,headers=headers).json()
|
workoutsummary = requests.get(url,headers=headers).json()
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
startdatetime = workoutsummary['start_date']
|
startdatetime = workoutsummary['start_date']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -2774,6 +2778,16 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
|
|||||||
coords = get_strava_stream(None,'latlng',stravaid,authorizationstring=authorizationstring)
|
coords = get_strava_stream(None,'latlng',stravaid,authorizationstring=authorizationstring)
|
||||||
power = get_strava_stream(None,'watts',stravaid,authorizationstring=authorizationstring)
|
power = get_strava_stream(None,'watts',stravaid,authorizationstring=authorizationstring)
|
||||||
|
|
||||||
|
t = time.localtime()
|
||||||
|
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
||||||
|
with open('strava_webhooks.log','a') as f:
|
||||||
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write(url)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('Response data {data}\n'.format(data=workoutsummary))
|
||||||
|
|
||||||
if t is not None:
|
if t is not None:
|
||||||
nr_rows = len(t)
|
nr_rows = len(t)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1064,6 +1064,13 @@ def strava_webhook_view(request):
|
|||||||
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
||||||
if ws.count()==0 and r.strava_auto_import:
|
if ws.count()==0 and r.strava_auto_import:
|
||||||
job = stravastuff.async_get_workout(r.user,stravaid)
|
job = stravastuff.async_get_workout(r.user,stravaid)
|
||||||
|
if job == 0:
|
||||||
|
timestamp = time.strftime('%b-%d-%Y_%H%M',t)
|
||||||
|
with open('strava_webhooks.log','a') as f:
|
||||||
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('Strava strava_open yielded NoTokenError')
|
||||||
else:
|
else:
|
||||||
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
|
||||||
with open('strava_webhooks.log','a') as f:
|
with open('strava_webhooks.log','a') as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user