def associate_by_email(details, user=None, *args, **kwargs):
 if user:
  return None
 email = details.get('email')
 if email:
  try:
   return {'user': UserSocialAuth.get_user_by_email(email=email)}
  except MultipleObjectsReturned:
   raise AuthException(kwargs['backend'], 'Not unique email address.')
  except ObjectDoesNotExist:
   pass

def associate_by_email ( details , user = None , * args , ** kwargs ) : if user : return None email = details . get ( 'email' ) if email : try : return { 'user' : UserSocialAuth . get_user_by_email ( email = email ) } except MultipleObjectsReturned : raise AuthException ( kwargs [ 'backend' ] , 'Not unique email address.' ) except ObjectDoesNotExist : pass
associate current auth with a user with the same email address in the db .