fixing fit api
This commit is contained in:
@@ -189,7 +189,10 @@ def sort_coordinates_ccw(coordinates):
|
||||
def crewnerdcourse(doc):
|
||||
courses = []
|
||||
for course in doc:
|
||||
name = course.findall('.//opengis:name', ns)[0].text
|
||||
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:
|
||||
|
||||
@@ -1283,7 +1283,12 @@ def handle_check_race_course(self,
|
||||
dologging(logfile2,"Did not find file "+f1)
|
||||
return 0
|
||||
|
||||
row.extend_data()
|
||||
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'])
|
||||
rowdata = rowdata.resample('100ms', on='dt').mean()
|
||||
rowdata = rowdata.interpolate()
|
||||
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()
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user