Merge branch 'release/v22.1.23'
This commit is contained in:
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -466,6 +466,14 @@ def strokedata_tcx(request):
|
||||
except Exception as e: # pragma: no cover
|
||||
dologging('apilog.log','TCX')
|
||||
dologging('apilog.log',e)
|
||||
if request.data:
|
||||
tcxdata = request.data
|
||||
tcxfilename = 'media/{code}.tcx'.format(code=uuid4().hex[:16])
|
||||
xml_string = ET.tostring(tcxdata, encoding='utf-8', method='xml').decode('utf-8')
|
||||
|
||||
with open(tcxfilename, 'w', encoding='utf-8') as xml_file:
|
||||
xml_file.write(xml_string)
|
||||
_ = myqueue(queuehigh, handle_sendemail_unrecognized, tcxfilename, "tcx parser")
|
||||
return HttpResponseNotAllowed("Could not parse TCX data")
|
||||
|
||||
|
||||
@@ -520,6 +528,7 @@ def strokedata_tcx(request):
|
||||
except Exception as e: # pragma: no cover
|
||||
dologging('apilog.log','TCX API endpoint')
|
||||
dologging('apilog.log',e)
|
||||
_ = myqueue(queuehigh, handle_sendemail_unrecognized, tcxfilename, "tcx parser")
|
||||
return HttpResponse(status=500)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user