diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 3f425cf4..753e9c87 100644 Binary files a/rowers/tests/testdata/testdata.tcx.gz and b/rowers/tests/testdata/testdata.tcx.gz differ diff --git a/rowers/views/.#apiviews.py b/rowers/views/.#apiviews.py new file mode 120000 index 00000000..bcadbe66 --- /dev/null +++ b/rowers/views/.#apiviews.py @@ -0,0 +1 @@ +sander@rowsandall-2.3950:1723351739 \ No newline at end of file diff --git a/rowers/views/apiviews.py b/rowers/views/apiviews.py index 278c6fda..caba6fe6 100644 --- a/rowers/views/apiviews.py +++ b/rowers/views/apiviews.py @@ -484,19 +484,24 @@ def strokedata_tcx(request): with open(tcxfilename, 'w', encoding='utf-8') as xml_file: xml_file.write(xml_string) - - duration = totaltime_sec_to_string(total_duration) + duration = totaltime_sec_to_string(total_duration) + try: startdatetime = arrow.get(start_time_str) #startdatetime = dt.strptime(start_time_str, "%Y-%m-%dT%H:%M:%S%z") startdate = startdatetime.date() partofday = part_of_day(startdatetime.hour) title = '{partofday} water'.format(partofday=partofday) + except Exception as e: + dologging('apilog.log','TCX error to get time') + dologging('apilog.log',e) + _ = myqueue(queuehigh, handle_sendemail_unrecognized, tcxfilename, "tcx parser") + - w = Workout(user=request.user.rower, - date=startdate, - name=title, - duration=duration) - w.save() + w = Workout(user=request.user.rower, + date=startdate, + name=title, + duration=duration) + w.save() # need workouttype, duration