mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 12:52:21 -06:00
Merge branch 'develop' into feature
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from decimal import Decimal
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .choices import WirelessChannelChoices
|
||||
|
||||
@@ -12,7 +13,7 @@ def get_channel_attr(channel, attr):
|
||||
Return the specified attribute of a given WirelessChannelChoices value.
|
||||
"""
|
||||
if channel not in WirelessChannelChoices.values():
|
||||
raise ValueError(f"Invalid channel value: {channel}")
|
||||
raise ValueError(_("Invalid channel value: {channel}").format(channel=channel))
|
||||
|
||||
channel_values = channel.split('-')
|
||||
attrs = {
|
||||
@@ -22,6 +23,6 @@ def get_channel_attr(channel, attr):
|
||||
'width': Decimal(channel_values[3]),
|
||||
}
|
||||
if attr not in attrs:
|
||||
raise ValueError(f"Invalid channel attribute: {attr}")
|
||||
raise ValueError(_("Invalid channel attribute: {name}").format(name=attr))
|
||||
|
||||
return attrs[attr]
|
||||
|
||||
Reference in New Issue
Block a user