mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #4838: Fix rack power utilization display for racks without devices
This commit is contained in:
parent
a260019a7f
commit
fa9ffb23ad
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
* [#4821](https://github.com/netbox-community/netbox/issues/4821) - Restrict group options by selected site when bulk editing VLANs
|
* [#4821](https://github.com/netbox-community/netbox/issues/4821) - Restrict group options by selected site when bulk editing VLANs
|
||||||
* [#4835](https://github.com/netbox-community/netbox/issues/4835) - Support passing multiple initial values for multiple choice fields
|
* [#4835](https://github.com/netbox-community/netbox/issues/4835) - Support passing multiple initial values for multiple choice fields
|
||||||
|
* [#4838](https://github.com/netbox-community/netbox/issues/4838) - Fix rack power utilization display for racks without devices
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ class Rack(ChangeLoggedModel, CustomFieldModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if power_stats:
|
if power_stats:
|
||||||
allocated_draw_total = sum(x['allocated_draw_total'] for x in power_stats)
|
allocated_draw_total = sum(x['allocated_draw_total'] or 0 for x in power_stats)
|
||||||
available_power_total = sum(x['available_power'] for x in power_stats)
|
available_power_total = sum(x['available_power'] for x in power_stats)
|
||||||
return int(allocated_draw_total / available_power_total * 100) or 0
|
return int(allocated_draw_total / available_power_total * 100) or 0
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user