now getting user info
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user