def social_auth_by_name_backends(request):
 def context_value():
  keys = [key for key in get_backends().keys()]
  accounts = dict(zip(keys, ([None] * len(keys))))
  user = request.user
  if user_is_authenticated(user):
   accounts.update(((assoc.provider, assoc) for assoc in UserSocialAuth.get_social_auth_for_user(user)))
  return accounts
 return {'social_auth': LazyDict(context_value)}

def social_auth_by_name_backends ( request ) : def context_value ( ) : keys = [ key for key in get_backends ( ) . keys ( ) ] accounts = dict ( zip ( keys , ( [ None ] * len ( keys ) ) ) ) user = request . user if user_is_authenticated ( user ) : accounts . update ( ( ( assoc . provider , assoc ) for assoc in UserSocialAuth . get_social_auth_for_user ( user ) ) ) return accounts return { 'social_auth' : LazyDict ( context_value ) }
load social auth current user data to context .