Merge branch 'release/v16.6.12'
This commit is contained in:
@@ -67,7 +67,7 @@ def get_token(code): # pragma: no cover
|
|||||||
post_data = {"grant_type": "authorization_code",
|
post_data = {"grant_type": "authorization_code",
|
||||||
"code": code,
|
"code": code,
|
||||||
"redirect_uri": POLAR_REDIRECT_URI,
|
"redirect_uri": POLAR_REDIRECT_URI,
|
||||||
}
|
}
|
||||||
|
|
||||||
auth_string = '{id}:{secret}'.format(
|
auth_string = '{id}:{secret}'.format(
|
||||||
id= POLAR_CLIENT_ID,
|
id= POLAR_CLIENT_ID,
|
||||||
@@ -107,7 +107,7 @@ def make_authorization_url(): # pragma: no cover
|
|||||||
params = {"client_id": POLAR_CLIENT_ID,
|
params = {"client_id": POLAR_CLIENT_ID,
|
||||||
"response_type": "code",
|
"response_type": "code",
|
||||||
"redirect_uri": POLAR_REDIRECT_URI,
|
"redirect_uri": POLAR_REDIRECT_URI,
|
||||||
"scope":"write"}
|
"scope":"write"}
|
||||||
import urllib
|
import urllib
|
||||||
url = "https://flow.polar.com/oauth2/authorization" +urllib.parse.urlencode(params)
|
url = "https://flow.polar.com/oauth2/authorization" +urllib.parse.urlencode(params)
|
||||||
|
|
||||||
@@ -146,6 +146,7 @@ from rowers.rower_rules import ispromember
|
|||||||
|
|
||||||
def get_all_new_workouts(available_data,testing=False):
|
def get_all_new_workouts(available_data,testing=False):
|
||||||
for record in available_data: # pragma: no cover
|
for record in available_data: # pragma: no cover
|
||||||
|
dologging('polar.log',str(record))
|
||||||
if testing:
|
if testing:
|
||||||
print(record)
|
print(record)
|
||||||
if record['data-type'] == 'EXERCISE':
|
if record['data-type'] == 'EXERCISE':
|
||||||
@@ -241,6 +242,7 @@ def get_polar_workouts(user):
|
|||||||
exercise_dict['filename'] = ''
|
exercise_dict['filename'] = ''
|
||||||
|
|
||||||
exercise_list.append(exercise_dict)
|
exercise_list.append(exercise_dict)
|
||||||
|
dologging('polar.log',str(exercise_dict))
|
||||||
|
|
||||||
# commit transaction
|
# commit transaction
|
||||||
requests.put(url, headers=headers)
|
requests.put(url, headers=headers)
|
||||||
|
|||||||
Reference in New Issue
Block a user