mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -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)
|
||||
|
||||
# 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)
|
||||
|
||||
def _get_content_type(self):
|
||||
|
Loading…
Reference in New Issue
Block a user