Skip to content

Instantly share code, notes, and snippets.

@karanmhatre1
Last active May 17, 2024 10:06
Show Gist options
  • Save karanmhatre1/c938fd139104577f375fb4806415c2a4 to your computer and use it in GitHub Desktop.
Save karanmhatre1/c938fd139104577f375fb4806415c2a4 to your computer and use it in GitHub Desktop.
Django Social Auth Pipeline function for fetching Google profile picture
def update_user_social_data(strategy, *args, **kwargs):
response = kwargs['response']
backend = kwargs['backend']
user = kwargs['user']
if response['picture']:
url = response['picture']
userProfile_obj = UserProfile()
userProfile_obj.user = user
userProfile_obj.picture = url
userProfile_obj.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment