warmingup/cd
This commit is contained in:
@@ -3599,6 +3599,7 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
return 0
|
||||
|
||||
data = response.json()
|
||||
|
||||
try:
|
||||
title = data['name']
|
||||
except KeyError:
|
||||
@@ -3621,6 +3622,21 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
except KeyError:
|
||||
is_commute = False
|
||||
|
||||
|
||||
try:
|
||||
subtype = data['sub_type']
|
||||
if subtype is not None:
|
||||
subtype = subtype.capitalize()
|
||||
except KeyError:
|
||||
subtype = None
|
||||
|
||||
try:
|
||||
is_race = data['race']
|
||||
if is_race is None:
|
||||
is_race = False
|
||||
except KeyError:
|
||||
is_race = False
|
||||
|
||||
url = "https://intervals.icu/api/v1/activity/{workoutid}/fit-file".format(workoutid=workoutid)
|
||||
|
||||
response = requests.get(url, headers=headers)
|
||||
@@ -3667,7 +3683,14 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
if is_commute:
|
||||
for w in ws:
|
||||
w.is_commute = True
|
||||
w.sub_type = "Commute"
|
||||
w.save()
|
||||
for w in ws:
|
||||
w.sub_type = subtype
|
||||
w.save()
|
||||
if is_race:
|
||||
w.is_race = True
|
||||
w.save()
|
||||
if ws.count() > 0:
|
||||
pss = PlannedSession.objects.filter(rower=rower,intervals_icu_id=paired_event_id)
|
||||
if pss.count() > 0:
|
||||
|
||||
Reference in New Issue
Block a user