endpoints/views.py
def add_endpoints_to_queue(request):
    """
    takes a list of selected endpoints and adds them to the user session under a key named
    "endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
    language stuff to show already selected items in the queue

    """
    logger.info("__ endpoints add_endpoints_to_queue __")
    required_fields = set(["endpoints", "group_id"])
    if not required_fields.issubset(request.POST):
        logger.error("not all required fields found in request")
        return render(request, "error.html", {"error": "Invalid Parameters in POST"})

    group_id = request.POST["group_id"]
    provider_instance = endpoint_provider.get_provider_instance_from_group(group_id)

    endpoint_queue = []
    endpoint_queue_names = []

    if "endpoint_queue" in request.session:
        endpoint_queue = request.session["endpoint_queue"]

    if "endpoint_queue_names" in request.session:
        endpoint_queue_names = request.session["endpoint_queue_names"]

    for e in request.POST.getlist("endpoints"):
        endpoint = provider_instance.get_endpoint_by_id(e)
        if endpoint not in endpoint_queue:
            endpoint_queue.append(endpoint)
            endpoint_queue_names.append(endpoint["name"])

    request.session["endpoint_queue"] = endpoint_queue
    request.session["endpoint_queue_names"] = endpoint_queue_names

    return HttpResponseRedirect("/endpoints/list/%s" % group_id)

    takes a list of selected endpoints and adds them to the user session under a key named
    "endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
    language stuff to show already selected items in the queue

    
takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
language stuff to show already selected items in the queue
takes a list of selected endpoints and adds them to the user session under a key named " endpoint_queue " . Also adds another list of " endpoint_queue_names " to avoid limitations with django template language stuff to show already selected items in the queue
def add_endpoints_to_queue(request):
    logger.info("__ endpoints add_endpoints_to_queue __")
    required_fields = set(["endpoints", "group_id"])
    if not required_fields.issubset(request.POST):
        logger.error("not all required fields found in request")
        return render(request, "error.html", {"error": "Invalid Parameters in POST"})
    group_id = request.POST["group_id"]
    provider_instance = endpoint_provider.get_provider_instance_from_group(group_id)
    endpoint_queue = []
    endpoint_queue_names = []
    if "endpoint_queue" in request.session:
        endpoint_queue = request.session["endpoint_queue"]
    if "endpoint_queue_names" in request.session:
        endpoint_queue_names = request.session["endpoint_queue_names"]
    for e in request.POST.getlist("endpoints"):
        endpoint = provider_instance.get_endpoint_by_id(e)
        if endpoint not in endpoint_queue:
            endpoint_queue.append(endpoint)
            endpoint_queue_names.append(endpoint["name"])
    request.session["endpoint_queue"] = endpoint_queue
    request.session["endpoint_queue_names"] = endpoint_queue_names
    return HttpResponseRedirect("/endpoints/list/%s" % group_id)
def add_endpoints_to_queue ( request ) : logger . info ( "__ endpoints add_endpoints_to_queue __" ) required_fields = set ( [ "endpoints" , "group_id" ] ) if not required_fields . issubset ( request . POST ) : logger . error ( "not all required fields found in request" ) return render ( request , "error.html" , { "error" : "Invalid Parameters in POST" } ) group_id = request . POST [ "group_id" ] provider_instance = endpoint_provider . get_provider_instance_from_group ( group_id ) endpoint_queue = [ ] endpoint_queue_names = [ ] if "endpoint_queue" in request . session : endpoint_queue = request . session [ "endpoint_queue" ] if "endpoint_queue_names" in request . session : endpoint_queue_names = request . session [ "endpoint_queue_names" ] for e in request . POST . getlist ( "endpoints" ) : endpoint = provider_instance . get_endpoint_by_id ( e ) if endpoint not in endpoint_queue : endpoint_queue . append ( endpoint ) endpoint_queue_names . append ( endpoint [ "name" ] ) request . session [ "endpoint_queue" ] = endpoint_queue request . session [ "endpoint_queue_names" ] = endpoint_queue_names return HttpResponseRedirect ( "/endpoints/list/%s" % group_id )
takes a list of selected endpoints and adds them to the user session under a key named
"endpoint_queue".
takes a list of selected endpoints and adds them to the user session under a key named " endpoint_queue " .
"""
    takes a list of selected endpoints and adds them to the user session under a key named
    "endpoint_queue". Also adds another list of "endpoint_queue_names" to avoid limitations with django template
    language stuff to show already selected items in the queue

    """
request