Private
Public Access
1
0

additional logging TP export

This commit is contained in:
Sander Roosendaal
2022-05-09 19:32:05 +02:00
parent 0c8ef754d1
commit f6be713e21

View File

@@ -4,6 +4,7 @@ import time
from django_rq import job
# All the functionality needed to connect to Runkeeper
from rowers.imports import *
from rowers.utils import dologging
# Python
import gzip
@@ -151,6 +152,9 @@ def uploadactivity(access_token, filename, description='',
headers=headers, verify=False)
if resp.status_code != 200: # pragma: no cover
dologging('tp_export.log',resp.status_code)
dologging('tp_export.log',resp.reason)
dologging('tp_export.log',json.dumps(data))
return 0, resp.reason, resp.status_code, headers
else:
return resp.json()[0]["Id"], "ok", 200, ""
@@ -193,6 +197,7 @@ def workout_tp_upload(user, w): # pragma: no cover
return 'Successfully synchronized to TrainingPeaks', tpid
else: # no tcxfile
dologging('tp_export.log','Failed to create tcx file')
message = "Upload to TrainingPeaks failed"
w.uploadedtotp = -1
tpid = -1