s
This commit is contained in:
@@ -2430,18 +2430,21 @@ class PlannedSession(models.Model):
|
|||||||
|
|
||||||
# interval string
|
# interval string
|
||||||
if self.interval_string:
|
if self.interval_string:
|
||||||
dct = trainingparser.parsetodict(self.interval_string)
|
try:
|
||||||
dct = [item for item in dct if item['value'] != 0]
|
dct = trainingparser.parsetodict(self.interval_string)
|
||||||
dct = trainingparser.tofitdict(dct)
|
dct = [item for item in dct if item['value'] != 0]
|
||||||
for step in dct['steps']:
|
dct = trainingparser.tofitdict(dct)
|
||||||
try:
|
for step in dct['steps']:
|
||||||
step['targetValue'] = int(step['targetValue'])
|
try:
|
||||||
step['targetValueLow'] = int(step['targetValueHigh'])
|
step['targetValue'] = int(step['targetValue'])
|
||||||
step['targetValueHigh'] = int(step['targetValueLow'])
|
step['targetValueLow'] = int(step['targetValueHigh'])
|
||||||
|
step['targetValueHigh'] = int(step['targetValueLow'])
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
self.steps = dct
|
self.steps = dct
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# sort units
|
# sort units
|
||||||
if self.sessionmode == 'distance':
|
if self.sessionmode == 'distance':
|
||||||
|
|||||||
@@ -2376,7 +2376,9 @@ def plannedsession_view(request,id=0,userid=0):
|
|||||||
'sessionsport',
|
'sessionsport',
|
||||||
'sessiontype',
|
'sessiontype',
|
||||||
'sessionmode','criterium',
|
'sessionmode','criterium',
|
||||||
'sessionvalue','sessionunit','comment',
|
'sessionvalue','sessionunit',
|
||||||
|
'approximate_distance','approximate_duration',
|
||||||
|
'comment',
|
||||||
],
|
],
|
||||||
'workouts': ws,
|
'workouts': ws,
|
||||||
'active':'nav-plan',
|
'active':'nav-plan',
|
||||||
|
|||||||
Reference in New Issue
Block a user