Skip to content

Commit

Permalink
Fixes #5410: Restore tags field on cable connection forms
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Dec 4, 2020
1 parent 584b810 commit e7f6433
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/version-2.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down
18 changes: 15 additions & 3 deletions netbox/dcim/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e7f6433

Please sign in to comment.