diff --git a/netbox/dcim/management/commands/trace_paths.py b/netbox/dcim/management/commands/trace_paths.py index 4bb81bfd4..d34a428e4 100644 --- a/netbox/dcim/management/commands/trace_paths.py +++ b/netbox/dcim/management/commands/trace_paths.py @@ -34,7 +34,7 @@ class Command(BaseCommand): Draw a simple progress bar 20 increments wide illustrating the specified percentage. """ bar_size = int(percentage / 5) - self.stdout.write(f"\r [{'#' * bar_size}{' ' * (20-bar_size)}] {int(percentage)}%", ending='') + self.stdout.write(f"\r [{'#' * bar_size}{' ' * (20 - bar_size)}] {int(percentage)}%", ending='') def handle(self, *model_names, **options): diff --git a/netbox/dcim/models/devices.py b/netbox/dcim/models/devices.py index 4b9689a22..e61c2feb8 100644 --- a/netbox/dcim/models/devices.py +++ b/netbox/dcim/models/devices.py @@ -222,7 +222,7 @@ class DeviceType(ImageAttachmentsMixin, PrimaryModel, WeightMixin): @property def get_full_name(self): - return f"{ self.manufacturer } { self.model }" + return f"{self.manufacturer} {self.model}" def to_yaml(self): data = { diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index f36b11033..d012a840f 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -2105,7 +2105,7 @@ class VirtualChassisTest(APIViewTestCases.APIViewTestCase): for j in range(0, 13): interfaces.append( # Interface name starts with parent device's position in VC; e.g. 1/1, 1/2, 1/3... - Interface(device=device, name=f'{i%3+1}/{j}', type=InterfaceTypeChoices.TYPE_1GE_FIXED) + Interface(device=device, name=f'{i % 3 + 1}/{j}', type=InterfaceTypeChoices.TYPE_1GE_FIXED) ) Interface.objects.bulk_create(interfaces) diff --git a/netbox/users/tests/test_api.py b/netbox/users/tests/test_api.py index 090ccc263..60adf990b 100644 --- a/netbox/users/tests/test_api.py +++ b/netbox/users/tests/test_api.py @@ -264,9 +264,9 @@ class ObjectPermissionTest( for i in range(3): objectpermission = ObjectPermission( - name=f'Permission {i+1}', + name=f'Permission {i + 1}', actions=['view', 'add', 'change', 'delete'], - constraints={'name': f'TEST{i+1}'} + constraints={'name': f'TEST{i + 1}'} ) objectpermission.save() objectpermission.object_types.add(object_type)