added str2bool for workstrokesonly
This commit is contained in:
@@ -4,6 +4,9 @@ import numpy as np
|
||||
|
||||
lbstoN = 4.44822
|
||||
|
||||
def str2bool(v):
|
||||
return v.lower() in ("yes", "true", "t", "1")
|
||||
|
||||
def uniqify(seq, idfun=None):
|
||||
# order preserving
|
||||
if idfun is None:
|
||||
|
||||
@@ -267,7 +267,11 @@ def splitstdata(lijst):
|
||||
|
||||
return [np.array(t),np.array(latlong)]
|
||||
|
||||
from utils import geo_distance,serialize_list,deserialize_list,uniqify
|
||||
from utils import (
|
||||
geo_distance,serialize_list,deserialize_list,uniqify,
|
||||
str2bool
|
||||
)
|
||||
|
||||
from rowers.models import checkworkoutuser
|
||||
|
||||
# Check if a user is a Coach member
|
||||
@@ -4401,7 +4405,7 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
|
||||
|
||||
workstrokesonly = True
|
||||
if request.method == 'POST' and 'workstrokesonly' in request.POST:
|
||||
workstrokesonly = request.POST['workstrokesonly']
|
||||
workstrokesonly = str2bool(request.POST['workstrokesonly'])
|
||||
|
||||
|
||||
# prepare data frame
|
||||
|
||||
Reference in New Issue
Block a user