Просмотр исходного кода

16315 - Cant filter changelog by object type (no results found) (#16324)

* Replaced "api=/api/extras/content-types/" with "/api/extras/object-types/" for JournalEntryFilterForm and ObjectChangeFilterForm.

* Addressed PR comment.

* Correct feature classifications

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Julio Oliveira at Encora 1 год назад
Родитель
Сommit
87109f5539
1 измененных файлов с 4 добавлено и 10 удалено
  1. 4 10
      netbox/extras/forms/filtersets.py

+ 4 - 10
netbox/extras/forms/filtersets.py

@@ -464,13 +464,10 @@ class JournalEntryFilterForm(NetBoxModelFilterSetForm):
         required=False,
         label=_('User')
     )
-    assigned_object_type_id = DynamicModelMultipleChoiceField(
-        queryset=ObjectType.objects.all(),
+    assigned_object_type_id = ContentTypeMultipleChoiceField(
+        queryset=ObjectType.objects.with_feature('journaling'),
         required=False,
         label=_('Object Type'),
-        widget=APISelectMultiple(
-            api_url='/api/extras/content-types/',
-        )
     )
     kind = forms.ChoiceField(
         label=_('Kind'),
@@ -507,11 +504,8 @@ class ObjectChangeFilterForm(SavedFiltersMixin, FilterForm):
         required=False,
         label=_('User')
     )
-    changed_object_type_id = DynamicModelMultipleChoiceField(
-        queryset=ObjectType.objects.all(),
+    changed_object_type_id = ContentTypeMultipleChoiceField(
+        queryset=ObjectType.objects.with_feature('change_logging'),
         required=False,
         label=_('Object Type'),
-        widget=APISelectMultiple(
-            api_url='/api/extras/content-types/',
-        )
     )