Private
Public Access
1
0

more loggin on strava webhooks

This commit is contained in:
Sander Roosendaal
2020-07-16 13:20:52 +02:00
parent 926e03b784
commit 8dbe4ba7e5
2 changed files with 26 additions and 2 deletions

View File

@@ -1071,6 +1071,15 @@ def strava_webhook_view(request):
ws = Workout.objects.filter(uploadedtostrava=stravaid)
if ws.count()==0:
job = stravastuff.async_get_workout(r.user,stravaid)
else:
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('Workouts already existing:\n ')
for w in ws:
f.write('{w} \n'.format(str(w)))
elif aspect_type == 'delete':
try:
stravaid = data['object_id']