Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2021-03-21 13:37:29 +01:00
parent 4b6d4c5072
commit e0770a17e6
2 changed files with 17 additions and 12 deletions

View File

@@ -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':

View File

@@ -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',