some experimenting, still 204 responses
This commit is contained in:
@@ -137,7 +137,7 @@ def get_polar_workout_list(user):
|
|||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def get_polar_user_info(user):
|
def get_polar_user_info(user,physical=False):
|
||||||
r = Rower.objects.get(user=user)
|
r = Rower.objects.get(user=user)
|
||||||
if (r.polartoken == '') or (r.polartoken is None):
|
if (r.polartoken == '') or (r.polartoken is None):
|
||||||
s = "Token doesn't exist. Need to authorize"
|
s = "Token doesn't exist. Need to authorize"
|
||||||
@@ -156,13 +156,22 @@ def get_polar_user_info(user):
|
|||||||
'user-id': r.polaruserid
|
'user-id': r.polaruserid
|
||||||
}
|
}
|
||||||
|
|
||||||
url = 'https://polaraccesslink.com/v3/users/{userid}'.format(
|
if not physical:
|
||||||
userid = r.polaruserid
|
url = 'https://polaraccesslink.com/v3/users/{userid}'.format(
|
||||||
|
userid = r.polaruserid
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
url = 'https://www.polaraccesslink.com/v3/users/{userid}/physical-information-transactions/'.format(
|
||||||
|
userid = r.polaruserid
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
print url
|
print url
|
||||||
response = requests.get(url, headers=headers)
|
|
||||||
|
if physical:
|
||||||
|
response = requests.post(url, headers=headers)
|
||||||
|
else:
|
||||||
|
response = requests.get(url, headers=headers)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user