not working yet
This commit is contained in:
@@ -20,7 +20,7 @@ from rowsandall_app.settings import (
|
|||||||
|
|
||||||
from rowers.tasks import (
|
from rowers.tasks import (
|
||||||
handle_c2_import_stroke_data, handle_c2_sync, handle_c2_async_workout,
|
handle_c2_import_stroke_data, handle_c2_sync, handle_c2_async_workout,
|
||||||
handle_c2_getworkout
|
handle_c2_getworkout, handle_c2_getworkout_csv
|
||||||
)
|
)
|
||||||
import django_rq
|
import django_rq
|
||||||
queue = django_rq.get_queue('default')
|
queue = django_rq.get_queue('default')
|
||||||
@@ -365,7 +365,7 @@ class C2Integration(SyncIntegration):
|
|||||||
record = create_or_update_syncrecord(r, None, c2id=id)
|
record = create_or_update_syncrecord(r, None, c2id=id)
|
||||||
|
|
||||||
_ = myqueue(queuehigh,
|
_ = myqueue(queuehigh,
|
||||||
handle_c2_getworkout,
|
handle_c2_getworkout_csv,
|
||||||
self.user.id,
|
self.user.id,
|
||||||
self.rower.c2token,
|
self.rower.c2token,
|
||||||
id,
|
id,
|
||||||
|
|||||||
@@ -3555,6 +3555,25 @@ def handle_intervals_getworkout(rower, intervalstoken, workoutid, debug=False, *
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@app.task
|
||||||
|
def handle_c2_getworkout_csv(userid, c2token, c2id, defaulttimezone, debug=False, **kwargs):
|
||||||
|
authorizationstring = str('Bearer ' + c2token)
|
||||||
|
headers = {'Authorization': authorizationstring,
|
||||||
|
'user-agent': 'sanderroosendaal',
|
||||||
|
'Content-Type': 'application/json'}
|
||||||
|
url = "https://log.concept2.com/api/users/me/results/"+str(c2id)+"/export/fit"
|
||||||
|
|
||||||
|
print(url)
|
||||||
|
print(c2token)
|
||||||
|
response = requests.get(url, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code != 200:
|
||||||
|
print(response.status_code, response.text)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
# get the file from the content data
|
||||||
|
print(response.status_code,"aap")
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def handle_c2_getworkout(userid, c2token, c2id, defaulttimezone, debug=False, **kwargs):
|
def handle_c2_getworkout(userid, c2token, c2id, defaulttimezone, debug=False, **kwargs):
|
||||||
authorizationstring = str('Bearer ' + c2token)
|
authorizationstring = str('Bearer ' + c2token)
|
||||||
|
|||||||
Reference in New Issue
Block a user