Преглед на файлове

Limit custom field object types to suitable models

jeremystretch преди 4 години
родител
ревизия
dc92e19f76
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      netbox/extras/forms/models.py

+ 2 - 0
netbox/extras/forms/models.py

@@ -32,6 +32,8 @@ class CustomFieldForm(BootstrapMixin, forms.ModelForm):
     )
     object_type = ContentTypeChoiceField(
         queryset=ContentType.objects.all(),
+        # TODO: Come up with a canonical way to register suitable models
+        limit_choices_to=FeatureQuery('webhooks'),
         required=False,
         help_text="Type of the related object (for object/multi-object fields only)"
     )