Private
Public Access
1
0

added str2bool for workstrokesonly

This commit is contained in:
Sander Roosendaal
2017-05-18 19:55:35 +02:00
parent ec2f5610cf
commit 1d9dd56951
2 changed files with 9 additions and 2 deletions

View File

@@ -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:

View File

@@ -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