def company_groups(request):
    form = CompanyGroupsForm(request.GET or None)
    company, nodes, links = None, [], []

    if form.is_valid():
        company = form.cleaned_data["company"]
        groups = _get_groups(company)
        nodes = groups["nodes"]
        links = groups["links"]

    context = {
        "form": form,
        "company": company,
        "nodes": nodes,
        "links": links
    }
    return render(request, "specials/company-groups.html", context)
def company_groups(request):
    form = CompanyGroupsForm(request.GET or None)
    company, nodes, links = None, [], []

    if form.is_valid():
        company = form.cleaned_data['company']
        groups = _get_groups(company)
        nodes = groups['nodes']
        links = groups['links']

    context = {
        'form': form,
        'company': company,
        'nodes': nodes,
        'links': links,
    }
    return render(request, 'specials/company-groups.html', context)