mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes: #18449 - Clean up some formatting errors
This commit is contained in:
parent
b913661297
commit
c56a39a168
@ -53,10 +53,10 @@ class ScopedFilterSet(BaseFilterSet):
|
|||||||
label=_('Site (slug)'),
|
label=_('Site (slug)'),
|
||||||
)
|
)
|
||||||
location_id = TreeNodeMultipleChoiceFilter(
|
location_id = TreeNodeMultipleChoiceFilter(
|
||||||
queryset=Location.objects.all(),
|
queryset=Location.objects.all(),
|
||||||
field_name='_location',
|
field_name='_location',
|
||||||
lookup_expr='in',
|
lookup_expr='in',
|
||||||
label=_('Location (ID)'),
|
label=_('Location (ID)'),
|
||||||
)
|
)
|
||||||
location = TreeNodeMultipleChoiceFilter(
|
location = TreeNodeMultipleChoiceFilter(
|
||||||
queryset=Location.objects.all(),
|
queryset=Location.objects.all(),
|
||||||
|
@ -1652,8 +1652,8 @@ class MACAddressFilterSet(NetBoxModelFilterSet):
|
|||||||
if not value.strip():
|
if not value.strip():
|
||||||
return queryset
|
return queryset
|
||||||
qs_filter = (
|
qs_filter = (
|
||||||
Q(mac_address__icontains=value) |
|
Q(mac_address__icontains=value) |
|
||||||
Q(description__icontains=value)
|
Q(description__icontains=value)
|
||||||
)
|
)
|
||||||
return queryset.filter(qs_filter)
|
return queryset.filter(qs_filter)
|
||||||
|
|
||||||
|
@ -660,8 +660,8 @@ class CustomFieldAPITest(APITestCase):
|
|||||||
CustomField(
|
CustomField(
|
||||||
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
|
||||||
name='boolean_field',
|
name='boolean_field',
|
||||||
default=False)
|
default=False
|
||||||
,
|
),
|
||||||
CustomField(
|
CustomField(
|
||||||
type=CustomFieldTypeChoices.TYPE_DATE,
|
type=CustomFieldTypeChoices.TYPE_DATE,
|
||||||
name='date_field',
|
name='date_field',
|
||||||
|
@ -361,7 +361,7 @@ class VLANTranslationRule(NetBoxModel):
|
|||||||
)
|
)
|
||||||
local_vid = models.PositiveSmallIntegerField(
|
local_vid = models.PositiveSmallIntegerField(
|
||||||
verbose_name=_('Local VLAN ID'),
|
verbose_name=_('Local VLAN ID'),
|
||||||
validators=(
|
validators=(
|
||||||
MinValueValidator(VLAN_VID_MIN),
|
MinValueValidator(VLAN_VID_MIN),
|
||||||
MaxValueValidator(VLAN_VID_MAX)
|
MaxValueValidator(VLAN_VID_MAX)
|
||||||
),
|
),
|
||||||
@ -369,7 +369,7 @@ class VLANTranslationRule(NetBoxModel):
|
|||||||
)
|
)
|
||||||
remote_vid = models.PositiveSmallIntegerField(
|
remote_vid = models.PositiveSmallIntegerField(
|
||||||
verbose_name=_('Remote VLAN ID'),
|
verbose_name=_('Remote VLAN ID'),
|
||||||
validators=(
|
validators=(
|
||||||
MinValueValidator(VLAN_VID_MIN),
|
MinValueValidator(VLAN_VID_MIN),
|
||||||
MaxValueValidator(VLAN_VID_MAX)
|
MaxValueValidator(VLAN_VID_MAX)
|
||||||
),
|
),
|
||||||
|
@ -150,8 +150,8 @@ class ClusterAddDevicesForm(forms.Form):
|
|||||||
for scope_field in ['site', 'location']:
|
for scope_field in ['site', 'location']:
|
||||||
device_scope = getattr(device, scope_field)
|
device_scope = getattr(device, scope_field)
|
||||||
if (
|
if (
|
||||||
self.cluster.scope_type.model_class() == apps.get_model('dcim', scope_field)
|
self.cluster.scope_type.model_class() == apps.get_model('dcim', scope_field) and
|
||||||
and device_scope != self.cluster.scope
|
device_scope != self.cluster.scope
|
||||||
):
|
):
|
||||||
raise ValidationError({
|
raise ValidationError({
|
||||||
'devices': _(
|
'devices': _(
|
||||||
|
Loading…
Reference in New Issue
Block a user