mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -06:00
Fix form field parameters
This commit is contained in:
parent
8b0633ebf2
commit
f95ceb7c14
@ -35,7 +35,7 @@ class NetBoxModelForm(BootstrapMixin, CustomFieldsMixin, forms.ModelForm):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
# Limit tags to those applicable to the object type
|
# Limit tags to those applicable to the object type
|
||||||
if ct := self._get_content_type():
|
if (ct := self._get_content_type()) and hasattr(self.fields['tags'].widget, 'add_query_param'):
|
||||||
self.fields['tags'].widget.add_query_param('for_object_type_id', ct.pk)
|
self.fields['tags'].widget.add_query_param('for_object_type_id', ct.pk)
|
||||||
|
|
||||||
def _get_content_type(self):
|
def _get_content_type(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user