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

Fixes #4134: Device power ports and outlets should inherit type from the parent device type

Jeremy Stretch 6 лет назад
Родитель
Сommit
009c0ba31c

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

@@ -17,6 +17,7 @@
 * [#4091](https://github.com/netbox-community/netbox/issues/4091) - Fix filtering of objects by custom fields using UI search form
 * [#4099](https://github.com/netbox-community/netbox/issues/4099) - Linkify interfaces on global interfaces list
 * [#4108](https://github.com/netbox-community/netbox/issues/4108) - Avoid extraneous database queries when rendering search forms
+* [#4134](https://github.com/netbox-community/netbox/issues/4134) - Device power ports and outlets should inherit type from the parent device type
 
 ---
 

+ 2 - 0
netbox/dcim/models/device_component_templates.py

@@ -168,6 +168,7 @@ class PowerPortTemplate(ComponentTemplateModel):
         return PowerPort(
             device=device,
             name=self.name,
+            type=self.type,
             maximum_draw=self.maximum_draw,
             allocated_draw=self.allocated_draw
         )
@@ -232,6 +233,7 @@ class PowerOutletTemplate(ComponentTemplateModel):
         return PowerOutlet(
             device=device,
             name=self.name,
+            type=self.type,
             power_port=power_port,
             feed_leg=self.feed_leg
         )