diff --git a/rowers/tpstuff.py b/rowers/tpstuff.py index 4996bf9c..de37f4e7 100644 --- a/rowers/tpstuff.py +++ b/rowers/tpstuff.py @@ -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