mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-04 06:38:16 -06:00
Respect the weight unit of the DeviceType when displaying the Device details
This commit is contained in:
parent
6b219a279b
commit
f769f773f1
@ -324,7 +324,11 @@
|
||||
<th scope="row">{% trans "Weight" %}</th>
|
||||
<td>
|
||||
{% if object.total_weight %}
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
{% if object.device_type.weight_unit == "lb" %}
|
||||
{{ object.total_weight|kg_to_pounds|floatformat }} {% trans "Pounds" %}
|
||||
{% elif object.device_type.weight_unit == "kg" %}
|
||||
{{ object.total_weight|floatformat }} {% trans "Kilograms" %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ ''|placeholder }}
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user