Merge branch 'release/v13.51'
This commit is contained in:
@@ -6,31 +6,30 @@
|
|||||||
<h1>Import and Export Settings for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
<h1>Import and Export Settings for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
||||||
|
|
||||||
<p>You are currently connected to:
|
<p>You are currently connected to:
|
||||||
{% if r.c2token %}
|
{% if rower.c2token is not None %}
|
||||||
Concept2 Logbook,
|
Concept2 Logbook,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.sporttrackstoken %}
|
{% if rower.sporttrackstoken is not None %}
|
||||||
SportTracks,
|
SportTracks,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.underarmourtoken %}
|
{% if rower.underarmourtoken is not None %}
|
||||||
Under Armour (MapMyFitness),
|
Under Armour (MapMyFitness),
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.tptoken %}
|
{% if rower.tptoken is not None %}
|
||||||
TrainingPeaks,
|
TrainingPeaks,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.polartoken %}
|
{% if rower.polartoken is not None %}
|
||||||
Polar,
|
Polar,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.garmintoken %}
|
{% if rower.garmintoken is not None %}
|
||||||
Garmin Connect,
|
Garmin Connect,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.stravatoken %}
|
{% if rower.stravatoken is not None %}
|
||||||
Strava,
|
Strava,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if r.runkeepertoken %}
|
{% if rower.runkeepertoken is not None %}
|
||||||
Runkeeper.
|
Runkeeper.
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Strava,
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
|
|||||||
@@ -1071,6 +1071,34 @@ def strava_webhook_view(request):
|
|||||||
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
||||||
if ws.count()==0:
|
if ws.count()==0:
|
||||||
job = stravastuff.async_get_workout(r.user,stravaid)
|
job = stravastuff.async_get_workout(r.user,stravaid)
|
||||||
|
elif aspect_type == 'delete':
|
||||||
|
try:
|
||||||
|
stravid = data['object_id']
|
||||||
|
except KeyError:
|
||||||
|
with open('strava_webhooks.log','a') as f:
|
||||||
|
f.write('\n')
|
||||||
|
f.write(timestamp)
|
||||||
|
f.write(' ')
|
||||||
|
f.write('KeyError line 10576')
|
||||||
|
try:
|
||||||
|
ws = Workout.objects.filter(uploadedtostrava=stravaid)
|
||||||
|
if ws.count() == 0:
|
||||||
|
return HttpResponse(status=200)
|
||||||
|
except Workout.DoesNotExist:
|
||||||
|
return HttpResponse(status=200)
|
||||||
|
try:
|
||||||
|
r = Rower.objects.get(strava_owner_id=strava_owner)
|
||||||
|
except Rower.DoesNotExist:
|
||||||
|
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('Rower not found')
|
||||||
|
return HttpResponse(status=200)
|
||||||
|
for w in ws:
|
||||||
|
if w.user == r:
|
||||||
|
w.delete()
|
||||||
elif aspect_type == 'update':
|
elif aspect_type == 'update':
|
||||||
try:
|
try:
|
||||||
updates = data['updates']
|
updates = data['updates']
|
||||||
|
|||||||
Reference in New Issue
Block a user