Commit dc9c52d7 by Chris Rossi Committed by Diana Huang

Pep8, pylint.

parent 2f9e9e24
...@@ -30,10 +30,10 @@ class Command(BaseCommand): ...@@ -30,10 +30,10 @@ class Command(BaseCommand):
raise CommandError("LINKEDIN_API is not configured") raise CommandError("LINKEDIN_API is not configured")
state = str(uuid.uuid4()) state = str(uuid.uuid4())
url= ("https://www.linkedin.com/uas/oauth2/authorization" url = ("https://www.linkedin.com/uas/oauth2/authorization"
"?response_type=code" "?response_type=code"
"&client_id=%s&state=%s&redirect_uri=%s" % ( "&client_id=%s&state=%s&redirect_uri=%s" % (
api['CLIENT_ID'], state, api['REDIRECT_URI'])) api['CLIENT_ID'], state, api['REDIRECT_URI']))
print "Let's log into your LinkedIn account." print "Let's log into your LinkedIn account."
print "Start by visiting this url:" print "Start by visiting this url:"
...@@ -54,13 +54,13 @@ class Command(BaseCommand): ...@@ -54,13 +54,13 @@ class Command(BaseCommand):
try: try:
response = urllib2.urlopen(url).read() response = urllib2.urlopen(url).read()
except urllib2.HTTPError, e: except urllib2.HTTPError, error:
print "!!ERROR!!" print "!!ERROR!!"
print e print error
print e.read() print error.read()
raise CommandError("Unable to retrieve access token") raise CommandError("Unable to retrieve access token")
access_token = json.loads(response)['access_token'] access_token = json.loads(response)['access_token']
try: try:
tokens = LinkedInTokens.objects.get() tokens = LinkedInTokens.objects.get()
tokens.access_token = access_token tokens.access_token = access_token
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment