Object types are not filtered appropriately when filtering custom fields #11786
Labels
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v3.4.4
Python version
3.8
Steps to Reproduce
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 forModelChoiceField
; its acceptance as a keyword argument seems to be incidental to support for the attribute onForeignKey
models fields.We'll need to devise an alternative solution for filtering
ModelChoiceFields
on non-model forms (e.g.CustomFieldFilterForm
).The text was updated successfully, but these errors were encountered: