mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-22 05:12:22 -06:00
* Enable E501 rule * Configure ruff formatter * Reformat migration files to fix line length violations * Fix various E501 errors * Move table template code to template_code.py & ignore E501 errors * Reformat raw SQL
This commit is contained in:
@@ -26,7 +26,10 @@ class ProxyHTTPConnection(HTTPConnection):
|
||||
try:
|
||||
from python_socks.sync import Proxy
|
||||
except ModuleNotFoundError as e:
|
||||
logger.info("Configuring an HTTP proxy using SOCKS requires the python_socks library. Check that it has been installed.")
|
||||
logger.info(
|
||||
"Configuring an HTTP proxy using SOCKS requires the python_socks library. Check that it has been "
|
||||
"installed."
|
||||
)
|
||||
raise e
|
||||
|
||||
proxy = Proxy.from_url(self._proxy_url, rdns=self.use_rdns)
|
||||
|
||||
@@ -443,7 +443,10 @@ class APIViewTestCases:
|
||||
# Compile list of fields to include
|
||||
fields_string = ''
|
||||
|
||||
file_fields = (strawberry_django.fields.types.DjangoFileType, strawberry_django.fields.types.DjangoImageType)
|
||||
file_fields = (
|
||||
strawberry_django.fields.types.DjangoFileType,
|
||||
strawberry_django.fields.types.DjangoImageType,
|
||||
)
|
||||
for field in type_class.__strawberry_definition__.fields:
|
||||
if (
|
||||
field.type in file_fields or (
|
||||
|
||||
@@ -427,9 +427,46 @@ class DynamicFilterLookupExpressionTest(TestCase):
|
||||
Rack.objects.bulk_create(racks)
|
||||
|
||||
devices = (
|
||||
Device(name='Device 1', device_type=device_types[0], role=roles[0], platform=platforms[0], serial='ABC', asset_tag='1001', site=sites[0], rack=racks[0], position=1, face=DeviceFaceChoices.FACE_FRONT, status=DeviceStatusChoices.STATUS_ACTIVE, local_context_data={"foo": 123}),
|
||||
Device(name='Device 2', device_type=device_types[1], role=roles[1], platform=platforms[1], serial='DEF', asset_tag='1002', site=sites[1], rack=racks[1], position=2, face=DeviceFaceChoices.FACE_FRONT, status=DeviceStatusChoices.STATUS_STAGED),
|
||||
Device(name='Device 3', device_type=device_types[2], role=roles[2], platform=platforms[2], serial='GHI', asset_tag='1003', site=sites[2], rack=racks[2], position=3, face=DeviceFaceChoices.FACE_REAR, status=DeviceStatusChoices.STATUS_FAILED),
|
||||
Device(
|
||||
name='Device 1',
|
||||
device_type=device_types[0],
|
||||
role=roles[0],
|
||||
platform=platforms[0],
|
||||
serial='ABC',
|
||||
asset_tag='1001',
|
||||
site=sites[0],
|
||||
rack=racks[0],
|
||||
position=1,
|
||||
face=DeviceFaceChoices.FACE_FRONT,
|
||||
status=DeviceStatusChoices.STATUS_ACTIVE,
|
||||
local_context_data={'foo': 123},
|
||||
),
|
||||
Device(
|
||||
name='Device 2',
|
||||
device_type=device_types[1],
|
||||
role=roles[1],
|
||||
platform=platforms[1],
|
||||
serial='DEF',
|
||||
asset_tag='1002',
|
||||
site=sites[1],
|
||||
rack=racks[1],
|
||||
position=2,
|
||||
face=DeviceFaceChoices.FACE_FRONT,
|
||||
status=DeviceStatusChoices.STATUS_STAGED,
|
||||
),
|
||||
Device(
|
||||
name='Device 3',
|
||||
device_type=device_types[2],
|
||||
role=roles[2],
|
||||
platform=platforms[2],
|
||||
serial='GHI',
|
||||
asset_tag='1003',
|
||||
site=sites[2],
|
||||
rack=racks[2],
|
||||
position=3,
|
||||
face=DeviceFaceChoices.FACE_REAR,
|
||||
status=DeviceStatusChoices.STATUS_FAILED,
|
||||
),
|
||||
)
|
||||
Device.objects.bulk_create(devices)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user