def _safe_postlogin_redirect(redirect_to, safehost, default_redirect='/'):
 if is_safe_url(url=redirect_to, host=safehost):
  return redirect(redirect_to)
 return redirect(default_redirect)

def _safe_postlogin_redirect ( redirect_to , safehost , default_redirect = '/' ) : if is_safe_url ( url = redirect_to , host = safehost ) : return redirect ( redirect_to ) return redirect ( default_redirect )
if redirect_to param is safe .