fix
This commit is contained in:
@@ -124,7 +124,7 @@ def add_workout_from_data(userid, nkid, data, strokedata, source='nk', splitdata
|
|||||||
try:
|
try:
|
||||||
workoutid = response.json()['id']
|
workoutid = response.json()['id']
|
||||||
except KeyError: # pragma: no cover
|
except KeyError: # pragma: no cover
|
||||||
workoutid = 1
|
workoutid = 0
|
||||||
|
|
||||||
# dologging('nklog.log','Workout ID {id}'.format(id=workoutid))
|
# dologging('nklog.log','Workout ID {id}'.format(id=workoutid))
|
||||||
|
|
||||||
|
|||||||
@@ -3411,9 +3411,12 @@ def handle_nk_async_workout(alldata, userid, nktoken, nkid, delaysec, defaulttim
|
|||||||
if workoutid == 0:
|
if workoutid == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
try:
|
||||||
workout = Workout.objects.get(id=workoutid)
|
workout = Workout.objects.get(id=workoutid)
|
||||||
newnkid = workout.uploadedtonk
|
newnkid = workout.uploadedtonk
|
||||||
sr = create_or_update_syncrecord(workout.user, workout, nkid=newnkid)
|
sr = create_or_update_syncrecord(workout.user, workout, nkid=newnkid)
|
||||||
|
except Workout.DoesNotExist:
|
||||||
|
pass
|
||||||
|
|
||||||
return workoutid
|
return workoutid
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ def mocked_session(*args, **kwargs):
|
|||||||
self.headers = MockHeaders()
|
self.headers = MockHeaders()
|
||||||
|
|
||||||
def post(self, *args, **kwargs):
|
def post(self, *args, **kwargs):
|
||||||
return MockResponse({},200)
|
return MockResponse({'id':1},200)
|
||||||
|
|
||||||
class MockHeaders:
|
class MockHeaders:
|
||||||
def update(*args, **kwargs):
|
def update(*args, **kwargs):
|
||||||
@@ -133,7 +133,6 @@ def mocked_session(*args, **kwargs):
|
|||||||
self.ok = True
|
self.ok = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return MockEngine()
|
return MockEngine()
|
||||||
|
|
||||||
def mocked_sqlalchemy(*args, **kwargs):
|
def mocked_sqlalchemy(*args, **kwargs):
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Binary file not shown.
@@ -5390,6 +5390,7 @@ def workout_upload_api(request):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
_ = send_confirm(r.user, t, link, '')
|
_ = send_confirm(r.user, t, link, '')
|
||||||
|
|
||||||
return JSONResponse(status=statuscode, data=message)
|
return JSONResponse(status=statuscode, data=message)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user