def save(self, commit=True): user = super(MemberCreationForm, self).save(commit=False) user.set_password(self.cleaned_data['password1']) if commit: user.save() image = ImageService.gravatar_image(user.email) if image: user.profile.image = image user.profile.save() return user
def save_user(self, request, sociallogin, form=None): user = super(MemberSocialAccountAdapter, self).save_user(request, sociallogin, form) fb_account = SocialAccount.objects.filter(user_id=user.id, provider='facebook') if fb_account.exists(): uid = fb_account[0].uid image = ImageService.facebook_image(uid) if image: user.profile.image = image user.profile.save() return user