added kfit and kfatigue to profile page
This commit is contained in:
@@ -1555,14 +1555,14 @@ def performancemanager_view(request,userid=0,mode='rower',
|
||||
therower = getrequestrower(request,userid=userid)
|
||||
theuser = therower.user
|
||||
|
||||
kfitness = 42
|
||||
kfatigue = 7
|
||||
kfitness = therower.kfit
|
||||
kfatigue = therower.kfatigue
|
||||
fitnesstest = 20
|
||||
metricchoice = 'trimp'
|
||||
modelchoice = 'tsb'
|
||||
usefitscore = False
|
||||
doform = False
|
||||
dofatigue = False
|
||||
doform = therower.showfresh
|
||||
dofatigue = therower.showfit
|
||||
|
||||
if request.method == 'POST':
|
||||
form = PerformanceManagerForm(request.POST)
|
||||
@@ -1572,6 +1572,9 @@ def performancemanager_view(request,userid=0,mode='rower',
|
||||
metricchoice = form.cleaned_data['metricchoice']
|
||||
dofatigue = form.cleaned_data['dofatigue']
|
||||
doform = form.cleaned_data['doform']
|
||||
therower.showfresh = doform
|
||||
therower.showfatigue = dofatigue
|
||||
therower.save()
|
||||
else:
|
||||
form = PerformanceManagerForm()
|
||||
|
||||
@@ -1600,7 +1603,7 @@ def performancemanager_view(request,userid=0,mode='rower',
|
||||
'script':script,
|
||||
'div':thediv,
|
||||
})
|
||||
|
||||
|
||||
return(HttpResponse(response,content_type='application/json'))
|
||||
|
||||
|
||||
|
||||
@@ -570,9 +570,13 @@ def rower_prefs_view(request,userid=0,message=""):
|
||||
if cpform.is_valid():
|
||||
cd = cpform.cleaned_data
|
||||
cprange = cd['cprange']
|
||||
kfit = cd['kfit']
|
||||
kfatigue = cd['kfatigue']
|
||||
r.cprange = cprange
|
||||
r.kfit = kfit
|
||||
r.kfatigue = kfatigue
|
||||
r.save()
|
||||
messages.info(request,'Updated CP range value')
|
||||
messages.info(request,'Updated CP range and time decay constants')
|
||||
success = dataprep.update_rolling_cp(r,mytypes.otwtypes,'water')
|
||||
success = dataprep.update_rolling_cp(r,mytypes.otetypes,'erg')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user