Private
Public Access
1
0

fixing errors

This commit is contained in:
2024-06-06 19:26:46 +02:00
parent 32272f0ea6
commit c42bc00f42
2 changed files with 12 additions and 6 deletions

View File

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

View File

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