1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Limit custom field object types to suitable models

This commit is contained in:
jeremystretch
2022-03-22 13:12:31 -04:00
parent ce87e0dfa4
commit dc92e19f76

View File

@ -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)"
)