Private
Public Access
1
0

Merge branch 'release/v22.1.23'

This commit is contained in:
2024-08-12 21:03:06 +02:00
2 changed files with 9 additions and 0 deletions

Binary file not shown.

View File

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