Private
Public Access
1
0

removed try/except in c2stuff

This commit is contained in:
Sander Roosendaal
2019-03-10 19:29:20 +01:00
parent 5a712b4f81
commit 42123831ae

View File

@@ -752,20 +752,16 @@ def workout_c2_upload(user,w):
c2id = -1
w.save()
elif (response.status_code == 201 or response.status_code == 200):
try:
# s= json.loads(response.text)
s = response.json()
c2id = s['data']['id']
w.uploadedtoc2 = c2id
w.save()
message = "Upload to Concept2 was successful"
except:
message = "Something went wrong in workout_c2_upload_view. Response code 200/201 but C2 sync failed: "+response.text
c2id = 0
# s= json.loads(response.text)
s = response.json()
c2id = s['data']['id']
w.uploadedtoc2 = c2id
w.save()
message = "Upload to Concept2 was successful"
# except:
# message = "Something went wrong in workout_c2_upload_view. Response code 200/201 but C2 sync failed: "+response.text
# c2id = 0
else:
message = "Something went wrong in workout_c2_upload_view. Response code 200/201 but C2 sync failed: "+response.text
c2id = 0
return message,c2id