From dc92e19f76571f58c40c696c58f3f074fbafc2f7 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Tue, 22 Mar 2022 13:12:31 -0400 Subject: [PATCH] Limit custom field object types to suitable models --- netbox/extras/forms/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netbox/extras/forms/models.py b/netbox/extras/forms/models.py index 68b4bf9c6..071f80453 100644 --- a/netbox/extras/forms/models.py +++ b/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)" )