fixing errors
This commit is contained in:
@@ -80,11 +80,14 @@ def getnearestcourses(lat_lon, courses, whatisnear=150, strict=False):
|
|||||||
newlist = []
|
newlist = []
|
||||||
counter = 0
|
counter = 0
|
||||||
for c in courses:
|
for c in courses:
|
||||||
distance = howfaris(lat_lon, c)
|
try:
|
||||||
|
distance = howfaris(lat_lon, c)
|
||||||
|
|
||||||
if distance < whatisnear:
|
if distance < whatisnear:
|
||||||
newlist.append(c)
|
newlist.append(c)
|
||||||
counter += 1
|
counter += 1
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
if counter > 0:
|
if counter > 0:
|
||||||
courses = newlist
|
courses = newlist
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from jinja2 import Environment, FileSystemLoader
|
|||||||
from rowers.rower_rules import can_view_session
|
from rowers.rower_rules import can_view_session
|
||||||
|
|
||||||
from django.forms.widgets import SelectDateWidget, HiddenInput
|
from django.forms.widgets import SelectDateWidget, HiddenInput
|
||||||
|
from polars.exceptions import ComputeError
|
||||||
|
|
||||||
def floatformat(x, prec=2): # pragma: no cover
|
def floatformat(x, prec=2): # pragma: no cover
|
||||||
return '{x}'.format(x=round(x, prec))
|
return '{x}'.format(x=round(x, prec))
|
||||||
@@ -945,8 +946,10 @@ def boxplotdata(workouts, options):
|
|||||||
except ColumnNotFoundError:
|
except ColumnNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
datadf = datadf.with_columns((pl.col("workoutid").apply(lambda x: datemapping[x])).alias("date"))
|
datadf = datadf.with_columns((pl.col("workoutid").apply(lambda x: datemapping[x])).alias("date"))
|
||||||
|
except ComputeError:
|
||||||
|
return ("","No Valid Data")
|
||||||
|
|
||||||
if userid == 0: # pragma: no cover
|
if userid == 0: # pragma: no cover
|
||||||
extratitle = ''
|
extratitle = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user