additional logging TP export
This commit is contained in:
@@ -4,6 +4,7 @@ import time
|
|||||||
from django_rq import job
|
from django_rq import job
|
||||||
# All the functionality needed to connect to Runkeeper
|
# All the functionality needed to connect to Runkeeper
|
||||||
from rowers.imports import *
|
from rowers.imports import *
|
||||||
|
from rowers.utils import dologging
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
import gzip
|
import gzip
|
||||||
@@ -151,6 +152,9 @@ def uploadactivity(access_token, filename, description='',
|
|||||||
headers=headers, verify=False)
|
headers=headers, verify=False)
|
||||||
|
|
||||||
if resp.status_code != 200: # pragma: no cover
|
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
|
return 0, resp.reason, resp.status_code, headers
|
||||||
else:
|
else:
|
||||||
return resp.json()[0]["Id"], "ok", 200, ""
|
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
|
return 'Successfully synchronized to TrainingPeaks', tpid
|
||||||
|
|
||||||
else: # no tcxfile
|
else: # no tcxfile
|
||||||
|
dologging('tp_export.log','Failed to create tcx file')
|
||||||
message = "Upload to TrainingPeaks failed"
|
message = "Upload to TrainingPeaks failed"
|
||||||
w.uploadedtotp = -1
|
w.uploadedtotp = -1
|
||||||
tpid = -1
|
tpid = -1
|
||||||
|
|||||||
Reference in New Issue
Block a user