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

This commit is contained in:
Jeremy Stretch 2020-02-11 14:18:45 -05:00
parent ec53e1c74c
commit 009c0ba31c
2 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@
* [#4091](https://github.com/netbox-community/netbox/issues/4091) - Fix filtering of objects by custom fields using UI search form * [#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 * [#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 * [#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
--- ---

View File

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