Private
Public Access
1
0

rojabo v2

This commit is contained in:
Sander Roosendaal
2022-10-31 20:58:06 +01:00
parent a20e93a0e6
commit cd8a0456c8
5 changed files with 80 additions and 6 deletions

View File

@@ -1113,13 +1113,23 @@ def workout_rojaboimport_view(request, message="", userid=0):
ps.save()
# get steps if there are any
steps = []
if item['warm_up']:
try:
steps.append(rojabostuff.stepsconvert(item['warm_up']))
except KeyError:
pass
if item['primary']:
try:
steps.append(rojabostuff.stepsconvert(item['primary']))
except KeyError:
pass
if item['cool_down']:
try:
steps.append(rojabostuff.stepsconvert(item['cool_down']))
except KeyError:
pass
if steps:
ps.steps = steps
ps.save()
messages.info(request,'Saved planned session {id}'.format(id=ps.id))
except KeyError:
pass