Merge branch 'develop' into feature

This commit is contained in:
Jeremy Stretch
2024-02-21 16:24:23 -05:00
98 changed files with 9468 additions and 4748 deletions

View File

@@ -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]