C2 upload tested and working
This commit is contained in:
@@ -76,6 +76,7 @@ def strip_tags(html):
|
||||
from rowers.dataprepnodjango import (
|
||||
update_strokedata, new_workout_from_file,
|
||||
getsmallrowdata_db, updatecpdata_sql,update_c2id_sql,
|
||||
update_workout_field_sql,
|
||||
update_agegroup_db,fitnessmetric_to_sql,
|
||||
add_c2_stroke_data_db,totaltime_sec_to_string,
|
||||
create_c2_stroke_data_db,update_empower,
|
||||
@@ -122,7 +123,7 @@ def add(x, y):
|
||||
|
||||
|
||||
@app.task
|
||||
def handle_c2_sync(workoutid,url,headers,data,debug=True,**kwargs):
|
||||
def handle_c2_sync(workoutid,url,headers,data,debug=False,**kwargs):
|
||||
response = requests.post(url,headers=headers,data=data)
|
||||
if response.status_code not in [200,201]:
|
||||
return 0
|
||||
@@ -130,7 +131,7 @@ def handle_c2_sync(workoutid,url,headers,data,debug=True,**kwargs):
|
||||
s = response.json()
|
||||
c2id = s['data']['id']
|
||||
|
||||
res = update_c2id_sql(workoutid,c2id)
|
||||
res = update_workout_field_sql(workoutid,'uploadedtoc2',c2id,debug=debug)
|
||||
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user