mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 12:56:24 -06:00
Style cleanup
This commit is contained in:
parent
563caa9af8
commit
3d244bfa37
@ -1627,7 +1627,7 @@ class MACAddressFilterSet(NetBoxModelFilterSet):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = MACAddress
|
model = MACAddress
|
||||||
fields = ('id', 'description', 'interface', 'assigned_object_type', 'assigned_object_id')
|
fields = ('id', 'description', 'is_primary', 'assigned_object_type', 'assigned_object_id')
|
||||||
|
|
||||||
def search(self, queryset, name, value):
|
def search(self, queryset, name, value):
|
||||||
if not value.strip():
|
if not value.strip():
|
||||||
|
@ -1289,7 +1289,6 @@ class MACAddressBulkEditForm(NetBoxModelBulkEditForm):
|
|||||||
model = MACAddress
|
model = MACAddress
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
FieldSet('description'),
|
FieldSet('description'),
|
||||||
# FieldSet('vrf', 'mask_length', 'dns_name', name=_('Addressing')),
|
|
||||||
)
|
)
|
||||||
nullable_fields = (
|
nullable_fields = (
|
||||||
'description', 'comments',
|
'description', 'comments',
|
||||||
|
@ -1519,7 +1519,7 @@ class MACAddress(PrimaryModel):
|
|||||||
super().clean()
|
super().clean()
|
||||||
|
|
||||||
if self.is_primary and self.assigned_object:
|
if self.is_primary and self.assigned_object:
|
||||||
if self.assigned_object.mac_addresses.filter(is_primary=True).exists():
|
if self.assigned_object.mac_addresses.filter(is_primary=True).exclude(pk=self.pk).exists():
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'is_primary': _("There is already a primary MAC address for this interface.")
|
'is_primary': _("There is already a primary MAC address for this interface.")
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,7 @@ from extras.models import ConfigTemplate
|
|||||||
from ipam.filtersets import PrimaryIPFilterSet
|
from ipam.filtersets import PrimaryIPFilterSet
|
||||||
from netbox.filtersets import OrganizationalModelFilterSet, NetBoxModelFilterSet
|
from netbox.filtersets import OrganizationalModelFilterSet, NetBoxModelFilterSet
|
||||||
from tenancy.filtersets import TenancyFilterSet, ContactModelFilterSet
|
from tenancy.filtersets import TenancyFilterSet, ContactModelFilterSet
|
||||||
from utilities.filters import MultiValueCharFilter, TreeNodeMultipleChoiceFilter, MultiValueMACAddressFilter
|
from utilities.filters import MultiValueCharFilter, MultiValueMACAddressFilter, TreeNodeMultipleChoiceFilter
|
||||||
from .choices import *
|
from .choices import *
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user