Merge branch 'release/v13.43'
This commit is contained in:
@@ -608,7 +608,7 @@ def handle_check_race_course(self,
|
|||||||
f.write(b'--- LOG of all gate times---')
|
f.write(b'--- LOG of all gate times---')
|
||||||
|
|
||||||
for path,polygon in zip(paths,polygons):
|
for path,polygon in zip(paths,polygons):
|
||||||
( secs,meters,completed) = coursetime_paths(rowdata2,
|
( secs,meters,completed) = coursetime_paths(rowdata,
|
||||||
[path],polygons=[polygon],logfile=logfile)
|
[path],polygons=[polygon],logfile=logfile)
|
||||||
with open(logfile,'ab') as f:
|
with open(logfile,'ab') as f:
|
||||||
line = " time: {t} seconds, distance: {m} meters".format(t=secs,m=meters)
|
line = " time: {t} seconds, distance: {m} meters".format(t=secs,m=meters)
|
||||||
|
|||||||
@@ -1082,7 +1082,9 @@ def strava_webhook_view(request):
|
|||||||
f.write('KeyError line 10576')
|
f.write('KeyError line 10576')
|
||||||
return HttpResponse(status=200)
|
return HttpResponse(status=200)
|
||||||
try:
|
try:
|
||||||
w = Workout.objects.get(uploadedtostrava=stravaid)
|
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
||||||
|
if len(ws) == 0:
|
||||||
|
return HttpResponse(status=200)
|
||||||
except Workout.DoesNotExist:
|
except Workout.DoesNotExist:
|
||||||
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:
|
||||||
@@ -1101,22 +1103,22 @@ def strava_webhook_view(request):
|
|||||||
f.write(' ')
|
f.write(' ')
|
||||||
f.write('Rower not found')
|
f.write('Rower not found')
|
||||||
return HttpResponse(status=200)
|
return HttpResponse(status=200)
|
||||||
print(updates)
|
|
||||||
for key, value in updates.items():
|
for key, value in updates.items():
|
||||||
if key == 'title':
|
for w in ws:
|
||||||
w.name = value
|
if key == 'title':
|
||||||
w.save()
|
w.name = value
|
||||||
if key == 'type':
|
|
||||||
try:
|
|
||||||
w.workouttype = mytypes.stravamappinginv[value]
|
|
||||||
w.save()
|
w.save()
|
||||||
except KeyError:
|
if key == 'type':
|
||||||
with open('strava_webhooks.log','a') as f:
|
try:
|
||||||
f.write('\n')
|
w.workouttype = mytypes.stravamappinginv[value]
|
||||||
f.write(timestamp)
|
w.save()
|
||||||
f.write(' ')
|
except KeyError:
|
||||||
f.write('Workout type not found: '+str(value))
|
with open('strava_webhooks.log','a') as f:
|
||||||
return HttpResponse(status=200)
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('Workout type not found: '+str(value))
|
||||||
|
return HttpResponse(status=200)
|
||||||
|
|
||||||
return HttpResponse(status=200)
|
return HttpResponse(status=200)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user