def get_next_redirect_url(request, redirect_field_name='next'):
 redirect_to = get_request_param(request, redirect_field_name)
 if (not get_adapter(request).is_safe_url(redirect_to)):
  redirect_to = None
 return redirect_to

def get_next_redirect_url ( request , redirect_field_name = 'next' ) : redirect_to = get_request_param ( request , redirect_field_name ) if ( not get_adapter ( request ) . is_safe_url ( redirect_to ) ) : redirect_to = None return redirect_to
returns the next url to redirect to .