Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when navigating Tenant Groups via Tenant breadcrumbs #5309

Closed
matt852 opened this issue Feb 20, 2024 · 6 comments · Fixed by #5361
Closed

Error when navigating Tenant Groups via Tenant breadcrumbs #5309

matt852 opened this issue Feb 20, 2024 · 6 comments · Fixed by #5361
Assignees
Labels
type: bug Something isn't working as expected

Comments

@matt852
Copy link
Contributor

matt852 commented Feb 20, 2024

Environment

  • Nautobot version (Docker tag too if applicable): 2.1.4
  • Python version: n/a
  • Database platform, version: n/a
  • Middleware(s): n/a

Steps to Reproduce

  1. Log into demo.nautobot.com
  2. Go to a Tenant that is assigned to a Tenant Group (ie: ABC LLC)
  3. In the breadcrumbs, click on the Tenant Group (ABC Holding Corp in this example)

Expected Behavior

I expect to be taken to the page for the selected Tenant Group.

Observed Behavior

Instead I am taken to a blank Tenants page, with an error banner displayed, saying:

Invalid filters were specified:
group
Unknown filter field

Screenshot 2024-02-20 at 4 31 01 PM
Screenshot 2024-02-20 at 4 31 10 PM

@matt852 matt852 added type: bug Something isn't working as expected triage This issue is new and has not been reviewed. labels Feb 20, 2024
@glennmatthews
Copy link
Contributor

Hyperlink needs to be updated to use tenant_group instead of group in 2.0.

@glennmatthews glennmatthews removed the triage This issue is new and has not been reviewed. label Feb 20, 2024
@jifox
Copy link
Contributor

jifox commented Feb 21, 2024

Same problem when filtering vlans in vlan groups. Here the group must be updated to vlan_group

http://localhost:9317/ipam/vlans/?group=VG-ATGW

@glennmatthews
Copy link
Contributor

@jifox can you specify where you're finding that incorrect link? Is it in a VLAN breadcrumb, or somewhere else?

@jifox
Copy link
Contributor

jifox commented Feb 22, 2024

@glennmatthews

I just open the VLANs and add a Filter for VLAN Group

image

@glennmatthews
Copy link
Contributor

Thanks! Looks like that's a bug in VLANFilterForm. Looks like an issue in PrefixForm.vlan as well.

@glennmatthews
Copy link
Contributor

We need to go through the code for anywhere in a filter, form, or link that has a group not prefixed with something and see if it needs fixing - at a glance, the below all look suspect:

nautobot/dcim/forms.py:        query_params={"group_id": "$cluster_group"},
nautobot/ipam/forms.py:            "group_id": "$vlan_group",
nautobot/ipam/forms.py:    group_id = DynamicModelMultipleChoiceField(
nautobot/ipam/templates/ipam/inc/vlangroup_header.html:        <a href="{% url 'ipam:vlan_add' %}?vid={{ first_available_vlan }}&group={{ object.pk }}{% if object.location %}&location={{ object.location.pk }}{% endif %}" class="btn btn-success">
nautobot/ipam/templates/ipam/vlan.html:        <li><a href="{% url 'ipam:vlan_list' %}?group={{ object.vlan_group.name }}">{{ object.vlan_group }}</a></li>
nautobot/tenancy/templates/tenancy/tenant.html:                    <li><a href="{% url 'tenancy:tenant_list' %}?group={{ object.tenant_group.name }}">{{ object.tenant_group }}</a></li>
nautobot/tenancy/templates/tenancy/tenantgroup.html:                    <a href="{% url 'tenancy:tenant_add' %}?group={{ object.pk }}" class="btn btn-xs btn-primary">
nautobot/virtualization/templates/virtualization/clustergroup.html:                        <a href="{% url 'virtualization:cluster_list' %}?group={{ object.name }}">{{ cluster_table.rows|length }}</a>
nautobot/virtualization/templates/virtualization/clustergroup.html:                    <a href="{% url 'virtualization:cluster_add' %}?group={{ object.pk }}" class="btn btn-xs btn-primary">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants