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