-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.4.4
Python version
3.8
Steps to Reproduce
- View the custom fields list in the UI
- Select the "filters" tab
- Open the "object type" filter dropdown
Expected Behavior
Only relevant object types (those to which custom fields can be assigned) should be included in the list.
Observed Behavior
All known object types are listed. (This affects several other models too, in addition to custom fields.)
It appears that Django does not acknowledge limit_choices_to when set on fields on non-model forms. Apparently this has never actually been a documented kwarg for ModelChoiceField; its acceptance as a keyword argument seems to be incidental to support for the attribute on ForeignKey models fields.
We'll need to devise an alternative solution for filtering ModelChoiceFields on non-model forms (e.g. CustomFieldFilterForm).
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application