Skip to content

Commit

Permalink
Use cgi.parse_qs instead of urlparse one, import ExpatError properly. C…
Browse files Browse the repository at this point in the history
…loses omabgh-78
  • Loading branch information
omab committed May 28, 2011
1 parent 2a47497 commit b8579fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions social_auth/backends/contrib/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
No extra configurations are needed to make this work.
"""
import urlparse
from cgi import parse_qs
from xml.etree import ElementTree
from xml.parsers.expat import ExpatError

from social_auth.backends import ConsumerBasedOAuth, OAuthBackend

Expand Down Expand Up @@ -51,10 +52,9 @@ def user_data(self, access_token):
data = _xml_to_dict(xml)
url = data['site-standard-profile-request']['url']
url = url.replace('&', '&')
data['id'] = urlparse.parse_qs(url)['key'][0]

data['id'] = parse_qs(url)['key'][0]
return data
except (xml.parsers.expat.ExpatError, KeyError, IndexError):
except (ExpatError, KeyError, IndexError):
return None

@classmethod
Expand Down

0 comments on commit b8579fa

Please sign in to comment.