Private
Public Access
1
0

now getting user info

This commit is contained in:
Sander Roosendaal
2018-06-05 08:22:59 +02:00
parent 2b86f03578
commit 3dd8921f54
2 changed files with 13 additions and 8 deletions

View File

@@ -101,7 +101,7 @@ def get_token(code):
return [thetoken,expires_in,user_id]
# Make authorization URL including random string
def make_authorization_url(request):
def make_authorization_url():
# Generate a random string for the state parameter
# Save it for use later to prevent xsrf attacks
from uuid import uuid4
@@ -114,6 +114,8 @@ def make_authorization_url(request):
import urllib
url = "https://flow.polar.com/oauth2/authorization" +urllib.urlencode(params)
print url
return HttpResponseRedirect(url)
def get_polar_workout_list(user):
@@ -133,6 +135,12 @@ def get_polar_workout_list(user):
userid = r.polaruserid
)
# url = 'https://polaraccesslink.com/v3/users/{userid}/activity-transactions'.format(
# userid = r.polaruserid
# )
print url
response = requests.post(url, headers=headers)
return response