mocked all c2stuff except workout export
This commit is contained in:
@@ -424,6 +424,7 @@ def do_refresh_token(refreshtoken):
|
||||
prepped.body+=scope
|
||||
|
||||
response = s.send(prepped)
|
||||
|
||||
token_json = response.json()
|
||||
try:
|
||||
thetoken = token_json['access_token']
|
||||
@@ -461,19 +462,8 @@ def get_token(code):
|
||||
prepped.body+="&scope="
|
||||
prepped.body+=scope
|
||||
|
||||
print prepped.body
|
||||
|
||||
response = s.send(prepped)
|
||||
|
||||
with open("media/c2authorize.log","a") as f:
|
||||
try:
|
||||
f.write(reponse.status_code+"\n")
|
||||
f.write(reponse.text+"\n")
|
||||
f.write(response.json+"\n\n")
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
token_json = response.json()
|
||||
|
||||
try:
|
||||
@@ -541,6 +531,7 @@ def get_workout(user,c2id):
|
||||
splitdata = data['workout']['intervals']
|
||||
|
||||
# Check if workout has stroke data, and get the stroke data
|
||||
|
||||
if data['stroke_data']:
|
||||
res2 = get_c2_workout_strokes(user,c2id)
|
||||
if res2.status_code == 200:
|
||||
@@ -692,7 +683,6 @@ def workout_c2_upload(user,w):
|
||||
c2id = 0
|
||||
|
||||
else:
|
||||
print response.status_code
|
||||
message = "Something went wrong in workout_c2_upload_view. Response code 200/201 but C2 sync failed: "+response.text
|
||||
c2id = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user