mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixes #13376: Restrict add/remove tag fields by model on bulk edit forms
This commit is contained in:
parent
2afce6c94b
commit
f1c182bb65
@ -127,6 +127,11 @@ class NetBoxModelBulkEditForm(BootstrapMixin, CustomFieldsMixin, forms.Form):
|
||||
|
||||
self.fields['pk'].queryset = self.model.objects.all()
|
||||
|
||||
# Restrict tag fields by model
|
||||
ct = ContentType.objects.get_for_model(self.model)
|
||||
self.fields['add_tags'].widget.add_query_param('for_object_type_id', ct.pk)
|
||||
self.fields['remove_tags'].widget.add_query_param('for_object_type_id', ct.pk)
|
||||
|
||||
self._extend_nullable_fields()
|
||||
|
||||
def _get_form_field(self, customfield):
|
||||
|
Loading…
Reference in New Issue
Block a user