forbidden saving ad hoc metrics as favorite chart
This commit is contained in:
@@ -8413,11 +8413,20 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
||||
workstrokesonly = request.POST['workstrokesonlysave']
|
||||
reststrokes = not workstrokesonly
|
||||
r = getrower(request.user)
|
||||
f = FavoriteChart(user=r,xparam=xparam,
|
||||
try:
|
||||
r = metrics.yaxmaxima[xparam]
|
||||
if yparam1 is not None:
|
||||
r = metrics.yaxmaxima[yparam1]
|
||||
if yparam2 is not None:
|
||||
r = metrics.yaxmaxima[yparam2]
|
||||
f = FavoriteChart(user=r,xparam=xparam,
|
||||
yparam1=yparam1,yparam2=yparam2,
|
||||
plottype=plottype,workouttype=workouttype,
|
||||
reststrokes=reststrokes)
|
||||
f.save()
|
||||
f.save()
|
||||
|
||||
except KeyError:
|
||||
messages.error(request,'We cannot save the ad hoc metrics in a favorite chart')
|
||||
|
||||
if request.method == 'POST' and 'workstrokesonly' in request.POST:
|
||||
workstrokesonly = request.POST['workstrokesonly']
|
||||
|
||||
Reference in New Issue
Block a user