def dsa_view(redirect_name=None):
 def dec(func):
  @wraps(func)
  def wrapper(request, backend, *args, **kwargs):
   if redirect_name:
    redirect = reverse(redirect_name, args=(backend,))
   else:
    redirect = request.path
   request.social_auth_backend = get_backend(backend, request, redirect)
   if (request.social_auth_backend is None):
    raise WrongBackend(backend)
   return func(request, request.social_auth_backend, *args, **kwargs)
  return wrapper
 return dec

def dsa_view ( redirect_name = None ) : def dec ( func ) : @ wraps ( func ) def wrapper ( request , backend , * args , ** kwargs ) : if redirect_name : redirect = reverse ( redirect_name , args = ( backend , ) ) else : redirect = request . path request . social_auth_backend = get_backend ( backend , request , redirect ) if ( request . social_auth_backend is None ) : raise WrongBackend ( backend ) return func ( request , request . social_auth_backend , * args , ** kwargs ) return wrapper return dec
decorate djangos-social-auth views .