some more wup and cd stuff
This commit is contained in:
@@ -471,6 +471,20 @@ class IntervalsIntegration(SyncIntegration):
|
||||
except KeyError:
|
||||
is_commute = False
|
||||
|
||||
try:
|
||||
is_race = data['race']
|
||||
if is_race is None:
|
||||
is_race = False
|
||||
except KeyError:
|
||||
is_race = False
|
||||
|
||||
try:
|
||||
subtype = data['sub_type']
|
||||
if subtype is not None:
|
||||
subtype = subtype.capitalize()
|
||||
except KeyError:
|
||||
subtype = None
|
||||
|
||||
try:
|
||||
workouttype = mytypes.intervalsmappinginv[data['type']]
|
||||
except KeyError:
|
||||
@@ -520,9 +534,17 @@ class IntervalsIntegration(SyncIntegration):
|
||||
pair_id = data['paired_event_id']
|
||||
pss = PlannedSession.objects.filter(intervals_icu_id=pair_id, rower=r)
|
||||
ws = Workout.objects.filter(uploadedtointervals=id)
|
||||
for w in ws:
|
||||
w.sub_type = subtype
|
||||
w.save()
|
||||
if is_commute:
|
||||
for w in ws:
|
||||
w.is_commute = True
|
||||
w.sub_type = "Commute"
|
||||
w.save()
|
||||
if is_race:
|
||||
for w in ws:
|
||||
w.is_race = True
|
||||
w.save()
|
||||
if pss.count() > 0:
|
||||
for ps in pss:
|
||||
|
||||
@@ -3680,17 +3680,18 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
||||
try:
|
||||
paired_event_id = data['paired_event_id']
|
||||
ws = Workout.objects.filter(uploadedtointervals=workoutid)
|
||||
for w in ws:
|
||||
w.sub_type = subtype
|
||||
w.save()
|
||||
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()
|
||||
for w in ws:
|
||||
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:
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user