Fixes #22444: Fix KeyError exception on device view with non-English locale (#22445)

This commit is contained in:
Jeremy Stretch 2026-06-13 20:10:29 -04:00 committed by GitHub
parent b4fdd6f209
commit 8ff56032b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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='{}%')

View File

@ -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')