Closes #18045: Enable adding a new MAC to an interface via quick add (#18200)

* Closes #18045: Enable adding a new MAC to an interface via quick add

* Misc cleanup
This commit is contained in:
Jeremy Stretch
2024-12-16 10:57:09 -05:00
committed by GitHub
parent 39ca3ce571
commit aa56b99566
6 changed files with 46 additions and 17 deletions

View File

@@ -3,9 +3,7 @@ from django.utils.translation import gettext_lazy as _
from dcim.choices import *
from dcim.constants import *
from dcim.models import MACAddress
from utilities.forms import get_field_value
from utilities.forms.fields import DynamicModelChoiceField
__all__ = (
'InterfaceCommonForm',
@@ -20,12 +18,6 @@ class InterfaceCommonForm(forms.Form):
max_value=INTERFACE_MTU_MAX,
label=_('MTU')
)
primary_mac_address = DynamicModelChoiceField(
queryset=MACAddress.objects.all(),
label=_('Primary MAC address'),
required=False,
quick_add=True
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)