Skip to content

Commit

Permalink
Fixes: #18449 - Clean up some formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Jan 21, 2025
1 parent b913661 commit c56a39a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions netbox/dcim/base_filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class ScopedFilterSet(BaseFilterSet):
label=_('Site (slug)'),
)
location_id = TreeNodeMultipleChoiceFilter(
queryset=Location.objects.all(),
field_name='_location',
lookup_expr='in',
label=_('Location (ID)'),
queryset=Location.objects.all(),
field_name='_location',
lookup_expr='in',
label=_('Location (ID)'),
)
location = TreeNodeMultipleChoiceFilter(
queryset=Location.objects.all(),
Expand Down
4 changes: 2 additions & 2 deletions netbox/dcim/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1652,8 +1652,8 @@ def search(self, queryset, name, value):
if not value.strip():
return queryset
qs_filter = (
Q(mac_address__icontains=value) |
Q(description__icontains=value)
Q(mac_address__icontains=value) |
Q(description__icontains=value)
)
return queryset.filter(qs_filter)

Expand Down
4 changes: 2 additions & 2 deletions netbox/extras/tests/test_customfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ def setUpTestData(cls):
CustomField(
type=CustomFieldTypeChoices.TYPE_BOOLEAN,
name='boolean_field',
default=False)
,
default=False
),
CustomField(
type=CustomFieldTypeChoices.TYPE_DATE,
name='date_field',
Expand Down
4 changes: 2 additions & 2 deletions netbox/ipam/models/vlans.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ class VLANTranslationRule(NetBoxModel):
)
local_vid = models.PositiveSmallIntegerField(
verbose_name=_('Local VLAN ID'),
validators=(
validators=(
MinValueValidator(VLAN_VID_MIN),
MaxValueValidator(VLAN_VID_MAX)
),
help_text=_("Numeric VLAN ID (1-4094)")
)
remote_vid = models.PositiveSmallIntegerField(
verbose_name=_('Remote VLAN ID'),
validators=(
validators=(
MinValueValidator(VLAN_VID_MIN),
MaxValueValidator(VLAN_VID_MAX)
),
Expand Down
4 changes: 2 additions & 2 deletions netbox/virtualization/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def clean(self):
for scope_field in ['site', 'location']:
device_scope = getattr(device, scope_field)
if (
self.cluster.scope_type.model_class() == apps.get_model('dcim', scope_field)
and device_scope != self.cluster.scope
self.cluster.scope_type.model_class() == apps.get_model('dcim', scope_field) and
device_scope != self.cluster.scope
):
raise ValidationError({
'devices': _(
Expand Down

0 comments on commit c56a39a

Please sign in to comment.