more pep
This commit is contained in:
@@ -57,8 +57,6 @@ queuehigh = django_rq.get_queue('high')
|
||||
# Project
|
||||
# from .models import Profile
|
||||
|
||||
|
||||
#baseurl = 'https://polaraccesslink.com/v3-example'
|
||||
baseurl = 'https://polaraccesslink.com/v3'
|
||||
|
||||
|
||||
@@ -125,7 +123,7 @@ def get_token(code):
|
||||
def make_authorization_url(): # pragma: no cover
|
||||
# Generate a random string for the state parameter
|
||||
# Save it for use later to prevent xsrf attacks
|
||||
state = str(uuid4())
|
||||
# state = str(uuid4())
|
||||
|
||||
params = {"client_id": POLAR_CLIENT_ID,
|
||||
"response_type": "code",
|
||||
@@ -155,7 +153,7 @@ def revoke_access(user): # pragma: no cover
|
||||
|
||||
def get_polar_notifications():
|
||||
url = baseurl+'/notifications'
|
||||
state = str(uuid4())
|
||||
# state = str(uuid4())
|
||||
auth_string = '{id}:{secret}'.format(
|
||||
id=POLAR_CLIENT_ID,
|
||||
secret=POLAR_CLIENT_SECRET
|
||||
@@ -302,16 +300,12 @@ def get_polar_workouts(user):
|
||||
'title': '',
|
||||
}
|
||||
|
||||
#session = requests.session()
|
||||
#newHeaders = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
||||
# session.headers.update(newHeaders)
|
||||
|
||||
url = settings.UPLOAD_SERVICE_URL
|
||||
|
||||
dologging('polar.log', uploadoptions)
|
||||
dologging('polar.log', url)
|
||||
#response = session.post(url,json=uploadoptions)
|
||||
job = myqueue(
|
||||
|
||||
_ = myqueue(
|
||||
queuehigh,
|
||||
handle_request_post,
|
||||
url,
|
||||
@@ -381,9 +375,6 @@ def register_user(user, token):
|
||||
json=payload,
|
||||
headers=headers
|
||||
)
|
||||
#url = baseurl+'/users'
|
||||
|
||||
#response = requests.post(url,params=params,headers=headers)
|
||||
|
||||
if response.status_code not in [200, 201]: # pragma: no cover
|
||||
# dologging('polar.log',url)
|
||||
@@ -419,10 +410,6 @@ def get_polar_user_info(user, physical=False): # pragma: no cover
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
|
||||
params = {
|
||||
'user-id': r.polaruserid
|
||||
}
|
||||
|
||||
if not physical:
|
||||
url = baseurl+'/users/{userid}'.format(
|
||||
userid=r.polaruserid
|
||||
@@ -478,11 +465,11 @@ def get_polar_workout(user, id, transactionid):
|
||||
exercise_dict = response.json()
|
||||
thisid = exercise_dict['id']
|
||||
if thisid == id:
|
||||
url = baseurl+'/users/{userid}/exercise-transactions/{transactionid}/exercises/{exerciseid}/tcx'.format(
|
||||
userid=r.polaruserid,
|
||||
transactionid=transactionid,
|
||||
exerciseid=id
|
||||
)
|
||||
url = baseurl+'/users/{userid}/exercise-transactions/{transactionid}' \
|
||||
'/exercises/{exerciseid}/tcx'.format(
|
||||
userid=r.polaruserid,
|
||||
transactionid=transactionid,
|
||||
exerciseid=id)
|
||||
authorizationstring = str('Bearer ' + r.polartoken)
|
||||
headers2 = {
|
||||
'Authorization': authorizationstring,
|
||||
|
||||
Reference in New Issue
Block a user