bug fixes in summary edit
This commit is contained in:
@@ -564,6 +564,9 @@ class WorkoutViewTest(TestCase):
|
||||
'value_pace':'2:23',
|
||||
'value_power':'200',
|
||||
'value_work':'400',
|
||||
'value_spm':'20',
|
||||
'activeminutesmin':'0',
|
||||
'activeminutesmax':'60',
|
||||
'savepowerpaceform':True,
|
||||
}
|
||||
|
||||
@@ -582,6 +585,8 @@ class WorkoutViewTest(TestCase):
|
||||
'power': 200,
|
||||
'pace': '2:30',
|
||||
'work': 400,
|
||||
'activeminutesmin':'0',
|
||||
'activeminutesmax': '60',
|
||||
}
|
||||
|
||||
form = PowerIntervalUpdateForm(form_data)
|
||||
|
||||
@@ -5676,8 +5676,15 @@ def workout_summary_edit_view(request,id,message="",successmessage=""
|
||||
value_spm = request.POST['value_spm']
|
||||
activeminutesmin = request.POST['activeminutesmin']
|
||||
activeminutesmax = request.POST['activeminutesmax']
|
||||
activesecondsmin = 60.*activeminutesmin
|
||||
activesecondsmax = 60.*activeminutesmax
|
||||
try:
|
||||
activesecondsmin = 60.*float(activeminutesmin)
|
||||
activesecondsmax = 60.*float(activeminutesmax)
|
||||
except ValueError:
|
||||
activesecondsmin = 0
|
||||
activeminutesmin = 0
|
||||
activeminutesmax = maxminutes
|
||||
activesecondsmax = rowdata.duration
|
||||
|
||||
if abs(rowdata.duration-activesecondsmax) < 60.:
|
||||
activesecondsmax = rowdata.duration
|
||||
if powerorpace == 'power':
|
||||
|
||||
Reference in New Issue
Block a user