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

Unable to filter Dynamic Groups #3612

Closed
tanleach opened this issue Apr 19, 2023 · 2 comments · Fixed by #3625
Closed

Unable to filter Dynamic Groups #3612

tanleach opened this issue Apr 19, 2023 · 2 comments · Fixed by #3625
Assignees
Labels
type: bug Something isn't working as expected

Comments

@tanleach
Copy link

Environment

  • Nautobot version (Docker tag too if applicable): v1.5.16
  • Python version: 3.10.11
  • Database platform, version: Postgres 15.1
  • Middleware(s): N/A

Steps to Reproduce

  1. <nautobot_url>/extras/dynamic-groups/?&content_type=ipam.prefix&q=

Expected Behavior

Dynamic groups would show only entries where content_type is 'ipam.prefix' (not specific to ipam.prefix)

Observed Behavior

Server Error:

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'KeyError'>

'dynamic groups'

Python version: 3.7.16
Nautobot version: 1.5.7

FWIW: also able to reproduce here: https://demo.nautobot.com/extras/dynamic-groups/?&content_type=dcim.device&q=

@bryanculver bryanculver added the type: bug Something isn't working as expected label Apr 19, 2023
@glennmatthews
Copy link
Contributor

Thanks for the report! Looks like a bug in the get_filterset_parameter_form_field function - it's looking for content-types corresponding to the feature dynamic groups but the feature is registered as dynamic_groups.

@jathanism jathanism self-assigned this Apr 20, 2023
@jathanism
Copy link
Contributor

jathanism commented Apr 20, 2023

Thanks for the report! Looks like a bug in the get_filterset_parameter_form_field function - it's looking for content-types corresponding to the feature dynamic groups but the feature is registered as dynamic_groups.

I did a little triage and determined that this occurs with the model._meta.verbose_name_plural being passed through without being slugified. I suspect we would run into this issue on other objects but it's somewhat hidden from other models of content_type relationships because most of them have single-word names and this is kind of a rare case where the model and the extras feature have the same name (dynamic_groups).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants