understands interval string when defining workout
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from rowers.views.statements import *
|
||||
from rowingdata import trainingparser
|
||||
|
||||
@login_required
|
||||
@permission_required('plannedsession.view_session',fn=get_session_by_pk,raise_exception=True)
|
||||
@@ -438,6 +439,9 @@ def plannedsession_create_view(request,
|
||||
comment = cd['comment']
|
||||
course = cd['course']
|
||||
name = cd['name']
|
||||
interval_string = cd['interval_string']
|
||||
|
||||
|
||||
|
||||
if sessionunit == 'min':
|
||||
sessionmode = 'time'
|
||||
@@ -460,6 +464,13 @@ def plannedsession_create_view(request,
|
||||
|
||||
ps.save()
|
||||
|
||||
if interval_string:
|
||||
dct = trainingparser.parsetodict(interval_string)
|
||||
dct = trainingparser.tofitdict(dct)
|
||||
txt = ps_dict_get_description(dct)
|
||||
ps.comment += '\n'+txt
|
||||
ps.save()
|
||||
|
||||
add_rower_session(r,ps)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user