Просмотр исходного кода

Fixes: #5221 - Fix bulk component creation over multiple VMs

Daniel Sheppard 5 лет назад
Родитель
Сommit
eadecf3eda
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      docs/release-notes/version-2.9.md
  2. 1 1
      netbox/utilities/views.py

+ 1 - 0
docs/release-notes/version-2.9.md

@@ -14,6 +14,7 @@
 * [#5206](https://github.com/netbox-community/netbox/issues/5206) - Apply user pagination preferences to all paginated object lists
 * [#5217](https://github.com/netbox-community/netbox/issues/5217) - Prevent erroneous removal of prefetched GenericForeignKey data from tables
 * [#5218](https://github.com/netbox-community/netbox/issues/5218) - Raise validation error if a power port's `allocated_draw` exceeds its `maximum_draw`
+* [#5221](https://github.com/netbox-community/netbox/issues/5221) - Fix bulk component creation for virtual machines
 
 ---
 

+ 1 - 1
netbox/utilities/views.py

@@ -1352,7 +1352,7 @@ class BulkComponentCreateView(GetReturnURLMixin, ObjectPermissionRequiredMixin,
                         for obj in data['pk']:
 
                             names = data['name_pattern']
-                            labels = data['label_pattern']
+                            labels = data['label_pattern'] if 'label_pattern' in data else None
                             for i, name in enumerate(names):
                                 label = labels[i] if labels else None