Last active
May 17, 2024 10:06
-
-
Save karanmhatre1/c938fd139104577f375fb4806415c2a4 to your computer and use it in GitHub Desktop.
Django Social Auth Pipeline function for fetching Google profile picture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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