From 8ff56032b9538e57d7e9a795ceeb4f37f118e2f0 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Sat, 13 Jun 2026 20:10:29 -0400 Subject: [PATCH] Fixes #22444: Fix KeyError exception on device view with non-English locale (#22445) --- netbox/dcim/ui/panels.py | 6 +++--- netbox/virtualization/ui/panels.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netbox/dcim/ui/panels.py b/netbox/dcim/ui/panels.py index 478ddf634..bd2adc7f6 100644 --- a/netbox/dcim/ui/panels.py +++ b/netbox/dcim/ui/panels.py @@ -32,7 +32,7 @@ class RackDimensionsPanel(panels.ObjectAttributesPanel): outer_width = attrs.NumericAttr('outer_width', unit_accessor='get_outer_unit_display') outer_height = attrs.NumericAttr('outer_height', unit_accessor='get_outer_unit_display') outer_depth = attrs.NumericAttr('outer_depth', unit_accessor='get_outer_unit_display') - mounting_depth = attrs.TextAttr('mounting_depth', format_string=_('{} millimeters')) + mounting_depth = attrs.TextAttr('mounting_depth', format_string=_('{0} millimeters')) class RackNumberingPanel(panels.ObjectAttributesPanel): @@ -355,8 +355,8 @@ class PowerFeedElectricalPanel(panels.ObjectAttributesPanel): title = _('Electrical Characteristics') supply = attrs.ChoiceAttr('supply') - voltage = attrs.TextAttr('voltage', format_string=_('{}V')) - amperage = attrs.TextAttr('amperage', format_string=_('{}A')) + voltage = attrs.TextAttr('voltage', format_string='{}V') + amperage = attrs.TextAttr('amperage', format_string='{}A') phase = attrs.ChoiceAttr('phase') max_utilization = attrs.TextAttr('max_utilization', format_string='{}%') diff --git a/netbox/virtualization/ui/panels.py b/netbox/virtualization/ui/panels.py index f562efc77..4132f0544 100644 --- a/netbox/virtualization/ui/panels.py +++ b/netbox/virtualization/ui/panels.py @@ -26,7 +26,7 @@ class VirtualMachineTypePanel(panels.ObjectAttributesPanel): name = attrs.TextAttr('name') default_platform = attrs.RelatedObjectAttr('default_platform', linkify=True) default_vcpus = attrs.TextAttr('default_vcpus', label=_('Default vCPUs')) - default_memory = attrs.TextAttr('default_memory', format_string=_('{} MB'), label=_('Default memory')) + default_memory = attrs.TextAttr('default_memory', format_string=_('{0} MB'), label=_('Default memory')) description = attrs.TextAttr('description')