From 74c29b0bb72bd6ba9a2ba1e19f8121da1d0f043e Mon Sep 17 00:00:00 2001 From: kobayashi Date: Tue, 26 May 2020 01:17:10 -0400 Subject: [PATCH] Fixes #4684: Fix ignored comment when importing DeviceType --- docs/release-notes/version-2.8.md | 1 + netbox/dcim/forms.py | 1 + netbox/dcim/tests/test_views.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/docs/release-notes/version-2.8.md b/docs/release-notes/version-2.8.md index 16712bb79..5507d420e 100644 --- a/docs/release-notes/version-2.8.md +++ b/docs/release-notes/version-2.8.md @@ -16,6 +16,7 @@ * [#4647](https://github.com/netbox-community/netbox/issues/4647) - Fix caching invalidation issue related to assigning new IP addresses to interfaces * [#4648](https://github.com/netbox-community/netbox/issues/4648) - Fix bulk CSV import of child devices * [#4649](https://github.com/netbox-community/netbox/issues/4649) - Fix interface assignment for bulk-imported IP addresses +* [#4684](https://github.com/netbox-community/netbox/issues/4684) - Fix ignored comment field when adding device type via YAML/JSON import. --- diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index cdd42ddae..94cf51fcd 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -932,6 +932,7 @@ class DeviceTypeImportForm(BootstrapMixin, forms.ModelForm): model = DeviceType fields = [ 'manufacturer', 'model', 'slug', 'part_number', 'u_height', 'is_full_depth', 'subdevice_role', + 'comments', ] diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 65f37c1d5..7ee5d7845 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -366,6 +366,7 @@ manufacturer: Generic model: TEST-1000 slug: test-1000 u_height: 2 +comments: test comment console-ports: - name: Console Port 1 type: de-9 @@ -456,6 +457,7 @@ device-bays: self.assertHttpStatus(response, 200) dt = DeviceType.objects.get(model='TEST-1000') + self.assertEqual(dt.comments, 'test comment') # Verify all of the components were created self.assertEqual(dt.consoleport_templates.count(), 3)