fix
This commit is contained in:
@@ -21,7 +21,13 @@ class XMLParser(BaseParser):
|
|||||||
media_type = "application/xml"
|
media_type = "application/xml"
|
||||||
|
|
||||||
def parse(self, stream, media_type=None, parser_context=None):
|
def parse(self, stream, media_type=None, parser_context=None):
|
||||||
return ET.parse(stream).getroot()
|
dologging("apilog.log", "XML Parser")
|
||||||
|
try:
|
||||||
|
s = ET.parse(stream).getroot()
|
||||||
|
except Exception as e:
|
||||||
|
dologging("apilog.log",e)
|
||||||
|
return HttpResponse(status=500)
|
||||||
|
return s
|
||||||
|
|
||||||
# Stroke data form to test API upload
|
# Stroke data form to test API upload
|
||||||
|
|
||||||
@@ -269,7 +275,7 @@ def strokedata_tcx(request):
|
|||||||
total_duration += lap_duration_seconds
|
total_duration += lap_duration_seconds
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
dologgin('apilog.log','TCX')
|
dologging('apilog.log','TCX')
|
||||||
dologging('apilog.log',e)
|
dologging('apilog.log',e)
|
||||||
return HttpResponseNotAllowed("Could not parse TCX data")
|
return HttpResponseNotAllowed("Could not parse TCX data")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user