forbidden saving ad hoc metrics as favorite chart
This commit is contained in:
@@ -3468,8 +3468,11 @@ def thumbnail_flex_chart(rowdata,id=0,promember=0,
|
|||||||
plot.yaxis.axis_label = 'Y'
|
plot.yaxis.axis_label = 'Y'
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
yrange1 = Range1d(start=yaxminima[yparam1],end=yaxmaxima[yparam1])
|
yrange1 = Range1d(start=yaxminima[yparam1],end=yaxmaxima[yparam1])
|
||||||
|
except KeyError:
|
||||||
|
yrange1 = Range1d(start=yparam1.min(), end=yparam1.max())
|
||||||
|
|
||||||
plot.y_range = yrange1
|
plot.y_range = yrange1
|
||||||
|
|
||||||
if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'):
|
if (xparam != 'time') and (xparam != 'distance') and (xparam != 'cumdist'):
|
||||||
|
|||||||
@@ -8413,11 +8413,20 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
|||||||
workstrokesonly = request.POST['workstrokesonlysave']
|
workstrokesonly = request.POST['workstrokesonlysave']
|
||||||
reststrokes = not workstrokesonly
|
reststrokes = not workstrokesonly
|
||||||
r = getrower(request.user)
|
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,
|
yparam1=yparam1,yparam2=yparam2,
|
||||||
plottype=plottype,workouttype=workouttype,
|
plottype=plottype,workouttype=workouttype,
|
||||||
reststrokes=reststrokes)
|
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:
|
if request.method == 'POST' and 'workstrokesonly' in request.POST:
|
||||||
workstrokesonly = request.POST['workstrokesonly']
|
workstrokesonly = request.POST['workstrokesonly']
|
||||||
|
|||||||
Reference in New Issue
Block a user