From e7f64334c06748b4b85c54d881f5e2b03b9463b5 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 4 Dec 2020 08:57:19 -0500 Subject: [PATCH] Fixes #5410: Restore tags field on cable connection forms --- docs/release-notes/version-2.9.md | 1 + netbox/dcim/forms.py | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index 7411ab14981..a2b00dc12c1 100644 --- a/docs/release-notes/version-2.9.md +++ b/docs/release-notes/version-2.9.md @@ -8,6 +8,7 @@ * [#5396](https://github.com/netbox-community/netbox/issues/5396) - Fix uniqueness constraint for virtual machine names * [#5407](https://github.com/netbox-community/netbox/issues/5407) - Add direct link to secret on secrets list * [#5408](https://github.com/netbox-community/netbox/issues/5408) - Fix updating secrets without setting new plaintext +* [#5410](https://github.com/netbox-community/netbox/issues/5410) - Restore tags field on cable connection forms --- diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 2132214a76e..aa7537c7b5c 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -3502,12 +3502,16 @@ class ConnectCableToDeviceForm(BootstrapMixin, forms.ModelForm): 'rack_id': '$termination_b_rack', } ) + tags = DynamicModelMultipleChoiceField( + queryset=Tag.objects.all(), + required=False + ) class Meta: model = Cable fields = [ 'termination_b_region', 'termination_b_site', 'termination_b_rack', 'termination_b_device', - 'termination_b_id', 'type', 'status', 'label', 'color', 'length', 'length_unit', + 'termination_b_id', 'type', 'status', 'label', 'color', 'length', 'length_unit', 'tags', ] widgets = { 'status': StaticSelect2, @@ -3635,12 +3639,16 @@ class ConnectCableToCircuitTerminationForm(BootstrapMixin, forms.ModelForm): 'circuit_id': '$termination_b_circuit' } ) + tags = DynamicModelMultipleChoiceField( + queryset=Tag.objects.all(), + required=False + ) class Meta: model = Cable fields = [ 'termination_b_provider', 'termination_b_region', 'termination_b_site', 'termination_b_circuit', - 'termination_b_id', 'type', 'status', 'label', 'color', 'length', 'length_unit', + 'termination_b_id', 'type', 'status', 'label', 'color', 'length', 'length_unit', 'tags', ] def clean_termination_b_id(self): @@ -3688,12 +3696,16 @@ class ConnectCableToPowerFeedForm(BootstrapMixin, forms.ModelForm): 'power_panel_id': '$termination_b_powerpanel' } ) + tags = DynamicModelMultipleChoiceField( + queryset=Tag.objects.all(), + required=False + ) class Meta: model = Cable fields = [ 'termination_b_rackgroup', 'termination_b_powerpanel', 'termination_b_id', 'type', 'status', 'label', - 'color', 'length', 'length_unit', + 'color', 'length', 'length_unit', 'tags', ] def clean_termination_b_id(self):