bug fix
This commit is contained in:
@@ -11295,6 +11295,10 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
|
|
||||||
normv,normw = dataprep.workout_normv(row,pp=8.0)
|
normv,normw = dataprep.workout_normv(row,pp=8.0)
|
||||||
|
|
||||||
|
work = int(normw)
|
||||||
|
power = int(normp)
|
||||||
|
pace_secs = int(500./normv)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
avpace = datetime.timedelta(seconds=int(500./normv))
|
avpace = datetime.timedelta(seconds=int(500./normv))
|
||||||
except:
|
except:
|
||||||
@@ -11331,7 +11335,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
itime,idist,itype = rowdata.intervalstats_values()
|
itime,idist,itype = rowdata.intervalstats_values()
|
||||||
nrintervals = len(idist)
|
nrintervals = len(idist)
|
||||||
savebutton = 'savestringform'
|
savebutton = 'savestringform'
|
||||||
powerupdateform = PowerIntervalUpdateForm()
|
powerupdateform = PowerIntervalUpdateForm(initial=data)
|
||||||
|
|
||||||
# we are saving the results obtained from the split by power/pace interpreter
|
# we are saving the results obtained from the split by power/pace interpreter
|
||||||
elif request.method == 'POST' and "savepowerpaceform" in request.POST:
|
elif request.method == 'POST' and "savepowerpaceform" in request.POST:
|
||||||
@@ -11341,18 +11345,13 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
value_work = request.POST['value_work']
|
value_work = request.POST['value_work']
|
||||||
if powerorpace == 'power':
|
if powerorpace == 'power':
|
||||||
power = int(value_power)
|
power = int(value_power)
|
||||||
pace_secs = 120.0
|
|
||||||
work = 400.
|
|
||||||
elif powerorpace == 'pace':
|
elif powerorpace == 'pace':
|
||||||
power = 0
|
|
||||||
try:
|
try:
|
||||||
pace_secs = float(value_pace)
|
pace_secs = float(value_pace)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pace_secs = float(value_pace.replace(',','.'))
|
pace_secs = float(value_pace.replace(',','.'))
|
||||||
elif powerorpace == 'work':
|
elif powerorpace == 'work':
|
||||||
power = 0
|
|
||||||
work = int(value_work)
|
work = int(value_work)
|
||||||
pace_secs = 120.0
|
|
||||||
|
|
||||||
if powerorpace == 'power' and power is not None:
|
if powerorpace == 'power' and power is not None:
|
||||||
try:
|
try:
|
||||||
@@ -11372,7 +11371,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
elif powerorpace == 'work':
|
elif powerorpace == 'work':
|
||||||
try:
|
try:
|
||||||
rowdata.updateinterval_metric(
|
rowdata.updateinterval_metric(
|
||||||
' WorkPerStroke (joules)',work,mode='larger',
|
'driveenergy',work,mode='larger',
|
||||||
debug=False,smoothwindow=15.)
|
debug=False,smoothwindow=15.)
|
||||||
except:
|
except:
|
||||||
messages.error(request,'Error updating Work per Stroke')
|
messages.error(request,'Error updating Work per Stroke')
|
||||||
@@ -11392,6 +11391,7 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
data = {
|
data = {
|
||||||
'power': power,
|
'power': power,
|
||||||
'pace': datetime.timedelta(seconds=int(pace_secs)),
|
'pace': datetime.timedelta(seconds=int(pace_secs)),
|
||||||
|
'work': work,
|
||||||
'selector': powerorpace
|
'selector': powerorpace
|
||||||
}
|
}
|
||||||
form = SummaryStringForm()
|
form = SummaryStringForm()
|
||||||
@@ -11433,7 +11433,12 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
messages.info(request,"Updated interval data saved")
|
messages.info(request,"Updated interval data saved")
|
||||||
data = {'intervalstring':s}
|
data = {'intervalstring':s}
|
||||||
form = SummaryStringForm(initial=data)
|
form = SummaryStringForm(initial=data)
|
||||||
powerupdateform = PowerIntervalUpdateForm()
|
powerupdateform = PowerIntervalUpdateForm(initial={
|
||||||
|
'power': int(normp),
|
||||||
|
'pace': avpace,
|
||||||
|
'selector': 'power',
|
||||||
|
'work': int(normw)
|
||||||
|
})
|
||||||
savebutton = 'savestringform'
|
savebutton = 'savestringform'
|
||||||
|
|
||||||
# we are saving the results obtained from the power update form
|
# we are saving the results obtained from the power update form
|
||||||
@@ -11539,7 +11544,13 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
|||||||
messages.info(request,"Updated interval data saved")
|
messages.info(request,"Updated interval data saved")
|
||||||
|
|
||||||
form = SummaryStringForm()
|
form = SummaryStringForm()
|
||||||
powerupdateform = PowerIntervalUpdateForm()
|
powerupdateform = PowerIntervalUpdateForm(initial={
|
||||||
|
'power': int(normp),
|
||||||
|
'pace': avpace,
|
||||||
|
'selector': 'power',
|
||||||
|
'work': int(normw)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
# we are processing the details form
|
# we are processing the details form
|
||||||
elif request.method == 'POST' and "nrintervals" in request.POST:
|
elif request.method == 'POST' and "nrintervals" in request.POST:
|
||||||
|
|||||||
Reference in New Issue
Block a user