From 944eadaf95101ddb26936a29a9b2476415b16107 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Thu, 14 Nov 2024 15:54:04 -0500 Subject: [PATCH] Standardize "MAC Address" instead of "MAC" --- netbox/dcim/forms/bulk_import.py | 6 +++--- netbox/dcim/forms/model_forms.py | 4 ++-- netbox/dcim/tables/devices.py | 2 +- netbox/templates/dcim/macaddress.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/netbox/dcim/forms/bulk_import.py b/netbox/dcim/forms/bulk_import.py index 05ae8d989..b049584ce 100644 --- a/netbox/dcim/forms/bulk_import.py +++ b/netbox/dcim/forms/bulk_import.py @@ -724,7 +724,7 @@ class MACAddressImportForm(NetBoxModelImportForm): ) is_primary = forms.BooleanField( label=_('Is primary'), - help_text=_('Make this the primary MAC for the assigned interface'), + help_text=_('Make this the primary MAC address for the assigned interface'), required=False ) @@ -764,11 +764,11 @@ class MACAddressImportForm(NetBoxModelImportForm): # TODO: scope to interface rather than device/VM if is_primary and not device and not virtual_machine: raise forms.ValidationError({ - "is_primary": _("No device or virtual machine specified; cannot set as primary MAC") + "is_primary": _("No device or virtual machine specified; cannot set as primary") }) if is_primary and not interface: raise forms.ValidationError({ - "is_primary": _("No interface specified; cannot set as primary MAC") + "is_primary": _("No interface specified; cannot set as primary") }) def save(self, *args, **kwargs): diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py index 0586bf0a2..00cf8272a 100644 --- a/netbox/dcim/forms/model_forms.py +++ b/netbox/dcim/forms/model_forms.py @@ -938,13 +938,13 @@ class MACAddressForm(NetBoxModelForm): assigned_object = self.cleaned_data[selected_objects[0]] if self.instance.pk and self.instance.assigned_object and self.instance.is_primary and assigned_object != self.instance.assigned_object: raise ValidationError( - _("Cannot reassign MAC address while it is designated as the primary MAC for the interface") + _("Cannot reassign MAC address while it is designated as the primary for the interface") ) self.instance.assigned_object = assigned_object else: self.instance.assigned_object = None - # Primary MAC assignment is only available if an interface has been assigned. + # Primary MAC address assignment is only available if an interface has been assigned. interface = self.cleaned_data.get('interface') or self.cleaned_data.get('vminterface') if self.cleaned_data.get('is_primary') and not interface: self.add_error( diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index ba6e22866..398b2e5a6 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -609,7 +609,7 @@ class MACAddressTable(NetBoxTable): verbose_name=_('Interface') ) is_primary = columns.BooleanColumn( - verbose_name=_('Primary MAC'), + verbose_name=_('Primary for Interface'), false_mark=None ) assigned_device = tables.Column( diff --git a/netbox/templates/dcim/macaddress.html b/netbox/templates/dcim/macaddress.html index d62edd550..5b8c0b478 100644 --- a/netbox/templates/dcim/macaddress.html +++ b/netbox/templates/dcim/macaddress.html @@ -28,7 +28,7 @@ - {% trans "Primary MAC for Interface" %} + {% trans "Primary MAC address for Interface" %} {% checkmark object.is_primary %}