Merge branch 'release/v18.9.12'
This commit is contained in:
@@ -665,9 +665,10 @@
|
|||||||
<td>POST</td>
|
<td>POST</td>
|
||||||
<td>
|
<td>
|
||||||
<pre>{
|
<pre>{
|
||||||
"totalDistance": 100,
|
"distance": 100,
|
||||||
"elapsedTime": 29000,
|
"elapsedTime": 29000,
|
||||||
"title": "Test Workout (GO)",
|
"duration": "0:00:29.0",
|
||||||
|
"name": "Test Workout (GO)",
|
||||||
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
||||||
"workouttype": "water",
|
"workouttype": "water",
|
||||||
"boattype": "1x",
|
"boattype": "1x",
|
||||||
|
|||||||
@@ -226,9 +226,10 @@ class OwnApi(TestCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
form_data = {
|
form_data = {
|
||||||
"totalDistance": 100,
|
"distance": 2100,
|
||||||
"elapsedTime": 29000,
|
"elapsedTime": 592,
|
||||||
"title": "Test Workout (GO)",
|
"duration": "0:09:52",
|
||||||
|
"name": "Test Workout (GO)",
|
||||||
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
||||||
"workouttype": "water",
|
"workouttype": "water",
|
||||||
"boattype": "1x",
|
"boattype": "1x",
|
||||||
|
|||||||
@@ -213,9 +213,10 @@ def strokedatajson_v3(request):
|
|||||||
GET: Get stroke data of workout
|
GET: Get stroke data of workout
|
||||||
This v2 API works on stroke based data dict:
|
This v2 API works on stroke based data dict:
|
||||||
{
|
{
|
||||||
"totalDistance": 100,
|
"distance": 2100,
|
||||||
"elapsedTime": 592,
|
"elapsedTime": 592,
|
||||||
"title": "Test Workout (GO)",
|
"duration": "0:09:52",
|
||||||
|
"name": "Test Workout (GO)",
|
||||||
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
"startdatetime": "2023-01-16 17:54:35.588838+00:00",
|
||||||
"workouttype": "water",
|
"workouttype": "water",
|
||||||
"boattype": "1x",
|
"boattype": "1x",
|
||||||
@@ -244,13 +245,21 @@ def strokedatajson_v3(request):
|
|||||||
|
|
||||||
dologging('apilog.log', request.user.username+" (strokedatajson_v3 POST)")
|
dologging('apilog.log', request.user.username+" (strokedatajson_v3 POST)")
|
||||||
|
|
||||||
title = request.data.get('title','')
|
title = request.data.get('name','')
|
||||||
try:
|
try:
|
||||||
elapsedTime = request.data['elapsedTime']
|
elapsedTime = request.data['elapsedTime']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return HttpResponse("Missing Elapsed Time", status=400)
|
try:
|
||||||
|
duration = request.data['duration']
|
||||||
|
try:
|
||||||
|
t = datetime.strptime(duration,"%H:%M:%S.%d")
|
||||||
|
except ValueError:
|
||||||
|
t = datetime.strptime(duration,"%H:%M:%S")
|
||||||
|
elapsedTime = 3600*t.hour+60.*t.minute+t.second+t.microsecond/1.e6
|
||||||
|
except:
|
||||||
|
return HttpResponse("Missing Elapsed Time", status=400)
|
||||||
try:
|
try:
|
||||||
totalDistance = request.data['totalDistance']
|
totalDistance = request.data['distance']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return HttpResponse("Missing Total Distance", status=400)
|
return HttpResponse("Missing Total Distance", status=400)
|
||||||
timeZone = request.data.get('timezone','UTC')
|
timeZone = request.data.get('timezone','UTC')
|
||||||
|
|||||||
Reference in New Issue
Block a user