Private
Public Access
1
0

fixing fit api

This commit is contained in:
2025-10-15 20:27:11 +02:00
parent f04351047f
commit d8339f653c
4 changed files with 16 additions and 5 deletions

View File

@@ -189,7 +189,10 @@ def sort_coordinates_ccw(coordinates):
def crewnerdcourse(doc):
courses = []
for course in doc:
try:
name = course.findall('.//opengis:name', ns)[0].text
except IndexError:
name = 'No name'
try:
description = course.findall('.//opengis:description', ns)[0].text
except IndexError:

View File

@@ -1283,7 +1283,12 @@ def handle_check_race_course(self,
dologging(logfile2,"Did not find file "+f1)
return 0
try:
row.extend_data()
except KeyError: # pragma: no cover
dologging(logfile,"Could not extend data")
dologging(logfile2,"Could not extend data")
return 0
# row.df.interpolate(inplace=True)
@@ -1315,8 +1320,11 @@ def handle_check_race_course(self,
).values
rowdata = rowdata.select_dtypes(['number'])
try:
rowdata = rowdata.resample('100ms', on='dt').mean()
rowdata = rowdata.interpolate()
except TypeError: # pragma: no cover
pass
course = GeoCourse.objects.get(id=courseid)
polygons = course.polygons.all()

Binary file not shown.

View File

@@ -644,7 +644,7 @@ def strokedata_fit(request):
dologging('apilog.log','FIT API endpoint')
dologging('apilog.log',e)
_ = myqueue(queuehigh, handle_sendemail_unrecognized, fit_filename, "fit parser")
return HttpResponse(status=500)
return JSONResponse({"error": "the uploaded file is corrupted or invalid and cannot be processed"}, status=422)