Skip to content

Commit

Permalink
get avatar from google, [refs #27]
Browse files Browse the repository at this point in the history
  • Loading branch information
st4lk committed May 25, 2016
1 parent 21cd2b8 commit 7ae6986
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example_project/users/social_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def save_avatar(strategy, details, user=None, *args, **kwargs):
"type=normal").format(response['id'])
elif 'twitter' in backend_name and response.get('profile_image_url'):
social_thumb = response['profile_image_url']
elif 'googleoauth2' in backend_name and response.get('image', {}).get('url'):
social_thumb = response['image']['url'].split('?')[0]
else:
social_thumb = "http://www.gravatar.com/avatar/"
social_thumb += hashlib.md5(user.email.lower().encode('utf8')).hexdigest()
Expand Down

0 comments on commit 7ae6986

Please sign in to comment.