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

Fixes: #18013 - All saved filters showing up for Change Log table, regardless of defined object type #18551

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

renatoalmeidaoliveira
Copy link
Contributor

Fixes: #18013 - All saved filters showing up for Change Log table, regardless of defined object type

Since ObjectChangeFilterForm doesn't inherid from NetBoxModelFilterSetForm the filter_id field doesn't get updated

Changes:

  • Add __init__ method to ObjectChangeFilterForm, and setup filter_id query_params

@renatoalmeidaoliveira
Copy link
Contributor Author

That issue also affects:
Config Contexts
Config Templates
Custom Fields
Custom Field Choice Sets
Custom Links
Export Templates
Saved Filters
Image Attachments
Jobs
Notification Groups

@renatoalmeidaoliveira
Copy link
Contributor Author

The current solution, solves the issue only for ChangeLog as reported in the issue.
For a broaden solution, IMO the best approach is change the SavedFiltersMixin adding a __init__ block that setups the object_type_id query_param in the filter_id widget and remove that block from NetBoxModelFilterSetForm
The solution also requires to add a model attribute for every FilterForm that doesn't have it already, like: JobFilterForm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All saved filters showing up for Change Log table, regardless of defined object type
1 participant