diff --git a/netbox/circuits/api/nested_serializers.py b/netbox/circuits/api/nested_serializers.py index 6de2cbf54..487749872 100644 --- a/netbox/circuits/api/nested_serializers.py +++ b/netbox/circuits/api/nested_serializers.py @@ -18,7 +18,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/circuits/tests/test_views.py b/netbox/circuits/tests/test_views.py index 87e6d99b7..b06ade30b 100644 --- a/netbox/circuits/tests/test_views.py +++ b/netbox/circuits/tests/test_views.py @@ -171,7 +171,7 @@ class CircuitTestCase(ViewTestCases.PrimaryObjectViewTestCase): ) cls.csv_update_data = ( - f"id,cid,description,status", + "id,cid,description,status", f"{circuits[0].pk},Circuit 7,New description7,{CircuitStatusChoices.STATUS_DECOMMISSIONED}", f"{circuits[1].pk},Circuit 8,New description8,{CircuitStatusChoices.STATUS_DECOMMISSIONED}", f"{circuits[2].pk},Circuit 9,New description9,{CircuitStatusChoices.STATUS_DECOMMISSIONED}", diff --git a/netbox/core/api/nested_serializers.py b/netbox/core/api/nested_serializers.py index 3b40853cf..df7b41ca7 100644 --- a/netbox/core/api/nested_serializers.py +++ b/netbox/core/api/nested_serializers.py @@ -16,7 +16,7 @@ __all__ = ( # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/core/data_backends.py b/netbox/core/data_backends.py index 8b36c6995..770a3b258 100644 --- a/netbox/core/data_backends.py +++ b/netbox/core/data_backends.py @@ -34,7 +34,7 @@ class LocalBackend(DataBackend): @contextmanager def fetch(self): - logger.debug(f"Data source type is local; skipping fetch") + logger.debug("Data source type is local; skipping fetch") local_path = urlparse(self.url).path # Strip file:// scheme yield local_path diff --git a/netbox/core/management/commands/syncdatasource.py b/netbox/core/management/commands/syncdatasource.py index aa8137952..990b6eb2a 100644 --- a/netbox/core/management/commands/syncdatasource.py +++ b/netbox/core/management/commands/syncdatasource.py @@ -26,7 +26,7 @@ class Command(BaseCommand): if invalid_names := set(options['name']) - found_names: raise CommandError(f"Invalid data source names: {', '.join(invalid_names)}") else: - raise CommandError(f"Must specify at least one data source, or set --all.") + raise CommandError("Must specify at least one data source, or set --all.") if len(options['name']) > 1: self.stdout.write(f"Syncing {len(datasources)} data sources.") @@ -43,4 +43,4 @@ class Command(BaseCommand): raise e if len(options['name']) > 1: - self.stdout.write(f"Finished.") + self.stdout.write("Finished.") diff --git a/netbox/core/models/data.py b/netbox/core/models/data.py index 717449506..6824b4605 100644 --- a/netbox/core/models/data.py +++ b/netbox/core/models/data.py @@ -125,7 +125,7 @@ class DataSource(JobsMixin, PrimaryModel): # Ensure URL scheme matches selected type if self.backend_class.is_local and self.url_scheme not in ('file', ''): raise ValidationError({ - 'source_url': f"URLs for local sources must start with file:// (or specify no scheme)" + 'source_url': "URLs for local sources must start with file:// (or specify no scheme)" }) def to_objectchange(self, action): diff --git a/netbox/core/models/jobs.py b/netbox/core/models/jobs.py index 655647ebb..e1b5715dd 100644 --- a/netbox/core/models/jobs.py +++ b/netbox/core/models/jobs.py @@ -118,9 +118,9 @@ class Job(models.Model): # TODO: Employ dynamic registration if self.object_type: if self.object_type.model == 'reportmodule': - return reverse(f'extras:report_result', kwargs={'job_pk': self.pk}) + return reverse('extras:report_result', kwargs={'job_pk': self.pk}) elif self.object_type.model == 'scriptmodule': - return reverse(f'extras:script_result', kwargs={'job_pk': self.pk}) + return reverse('extras:script_result', kwargs={'job_pk': self.pk}) return reverse('core:job', args=[self.pk]) def get_status_color(self): diff --git a/netbox/dcim/api/nested_serializers.py b/netbox/dcim/api/nested_serializers.py index 5d83b9145..4b8f0db4a 100644 --- a/netbox/dcim/api/nested_serializers.py +++ b/netbox/dcim/api/nested_serializers.py @@ -56,7 +56,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/dcim/forms/object_create.py b/netbox/dcim/forms/object_create.py index f811700b4..d18c7ed14 100644 --- a/netbox/dcim/forms/object_create.py +++ b/netbox/dcim/forms/object_create.py @@ -261,8 +261,8 @@ class FrontPortCreateForm(ComponentCreateForm, model_forms.FrontPortForm): # TODO: Clean up the application of HTMXSelect attributes attrs={ 'hx-get': '.', - 'hx-include': f'#form_fields', - 'hx-target': f'#form_fields', + 'hx-include': '#form_fields', + 'hx-target': '#form_fields', } ) ) diff --git a/netbox/dcim/management/commands/trace_paths.py b/netbox/dcim/management/commands/trace_paths.py index d34a428e4..592aeb6a7 100644 --- a/netbox/dcim/management/commands/trace_paths.py +++ b/netbox/dcim/management/commands/trace_paths.py @@ -60,7 +60,7 @@ class Command(BaseCommand): self.stdout.write((self.style.SUCCESS(f' Deleted {deleted_count} paths'))) # Reinitialize the model's PK sequence - self.stdout.write(f'Resetting database sequence for CablePath model') + self.stdout.write('Resetting database sequence for CablePath model') sequence_sql = connection.ops.sequence_reset_sql(no_style(), [CablePath]) with connection.cursor() as cursor: for sql in sequence_sql: diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index 573fdbb96..1b460cd59 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -2135,12 +2135,12 @@ class ConnectedDeviceTest(APITestCase): def test_get_connected_device(self): url = reverse('dcim-api:connected-device-list') - url_params = f'?peer_device=TestDevice1&peer_interface=eth0' + url_params = '?peer_device=TestDevice1&peer_interface=eth0' response = self.client.get(url + url_params, **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(response.data['name'], 'TestDevice2') - url_params = f'?peer_device=TestDevice1&peer_interface=eth1' + url_params = '?peer_device=TestDevice1&peer_interface=eth1' response = self.client.get(url + url_params, **self.header) self.assertHttpStatus(response, status.HTTP_404_NOT_FOUND) diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 7d6c34337..e290a6d1d 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -2571,7 +2571,7 @@ class InterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase): } cls.csv_data = ( - f"device,name,type,vrf.pk,poe_mode,poe_type", + "device,name,type,vrf.pk,poe_mode,poe_type", f"Device 1,Interface 4,1000base-t,{vrfs[0].pk},pse,type1-ieee802.3af", f"Device 1,Interface 5,1000base-t,{vrfs[0].pk},pse,type1-ieee802.3af", f"Device 1,Interface 6,1000base-t,{vrfs[0].pk},pse,type1-ieee802.3af", diff --git a/netbox/extras/api/nested_serializers.py b/netbox/extras/api/nested_serializers.py index ba291b34e..235cdd6d6 100644 --- a/netbox/extras/api/nested_serializers.py +++ b/netbox/extras/api/nested_serializers.py @@ -24,7 +24,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/extras/jobs.py b/netbox/extras/jobs.py index e540ef439..64a7d6a69 100644 --- a/netbox/extras/jobs.py +++ b/netbox/extras/jobs.py @@ -48,7 +48,7 @@ class ScriptJob(JobRunner): except AbortTransaction: script.log_info(message=_("Database changes have been reverted automatically.")) if script.failed: - logger.warning(f"Script failed") + logger.warning("Script failed") raise except Exception as e: diff --git a/netbox/extras/management/commands/housekeeping.py b/netbox/extras/management/commands/housekeeping.py index cb8137ee2..ade486fc0 100644 --- a/netbox/extras/management/commands/housekeeping.py +++ b/netbox/extras/management/commands/housekeeping.py @@ -95,7 +95,7 @@ class Command(BaseCommand): self.stdout.write("[*] Checking for latest release") if settings.ISOLATED_DEPLOYMENT: if options['verbosity']: - self.stdout.write(f"\tSkipping: ISOLATED_DEPLOYMENT is enabled") + self.stdout.write("\tSkipping: ISOLATED_DEPLOYMENT is enabled") elif settings.RELEASE_CHECK_URL: headers = { 'Accept': 'application/vnd.github.v3+json', @@ -129,7 +129,7 @@ class Command(BaseCommand): self.stdout.write(f"\tRequest error: {exc}", self.style.ERROR) else: if options['verbosity']: - self.stdout.write(f"\tSkipping: RELEASE_CHECK_URL not set") + self.stdout.write("\tSkipping: RELEASE_CHECK_URL not set") if options['verbosity']: self.stdout.write("Finished.", self.style.SUCCESS) diff --git a/netbox/extras/management/commands/reindex.py b/netbox/extras/management/commands/reindex.py index 5aab74511..21442be93 100644 --- a/netbox/extras/management/commands/reindex.py +++ b/netbox/extras/management/commands/reindex.py @@ -96,9 +96,9 @@ class Command(BaseCommand): if i: self.stdout.write(f'{i} entries cached.') else: - self.stdout.write(f'No objects found.') + self.stdout.write('No objects found.') - msg = f'Completed.' + msg = 'Completed.' if total_count := search_backend.size: msg += f' Total entries: {total_count}' self.stdout.write(msg, self.style.SUCCESS) diff --git a/netbox/extras/management/commands/runscript.py b/netbox/extras/management/commands/runscript.py index ab0d6d894..d5fb435ad 100644 --- a/netbox/extras/management/commands/runscript.py +++ b/netbox/extras/management/commands/runscript.py @@ -51,7 +51,7 @@ class Command(BaseCommand): user = User.objects.filter(is_superuser=True).order_by('pk')[0] # Setup logging to Stdout - formatter = logging.Formatter(f'[%(asctime)s][%(levelname)s] - %(message)s') + formatter = logging.Formatter('[%(asctime)s][%(levelname)s] - %(message)s') stdouthandler = logging.StreamHandler(sys.stdout) stdouthandler.setLevel(logging.DEBUG) stdouthandler.setFormatter(formatter) diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index 91de7df0d..8b7fc0cb6 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -283,7 +283,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel): """ for ct in content_types: model = ct.model_class() - instances = model.objects.exclude(**{f'custom_field_data__contains': self.name}) + instances = model.objects.exclude(**{'custom_field_data__contains': self.name}) for instance in instances: instance.custom_field_data[self.name] = self.default model.objects.bulk_update(instances, ['custom_field_data'], batch_size=100) diff --git a/netbox/extras/scripts.py b/netbox/extras/scripts.py index 96d08d8af..f2bd75a1d 100644 --- a/netbox/extras/scripts.py +++ b/netbox/extras/scripts.py @@ -554,7 +554,7 @@ class BaseScript: """ Run the report and save its results. Each test method will be executed in order. """ - self.logger.info(f"Running report") + self.logger.info("Running report") try: for test_name in self.tests: diff --git a/netbox/extras/tests/test_views.py b/netbox/extras/tests/test_views.py index 796d36180..5d82fae4c 100644 --- a/netbox/extras/tests/test_views.py +++ b/netbox/extras/tests/test_views.py @@ -417,7 +417,7 @@ class EventRulesTestCase(ViewTestCases.PrimaryObjectViewTestCase): } cls.csv_data = ( - f'name,object_types,event_types,action_type,action_object', + 'name,object_types,event_types,action_type,action_object', f'Webhook 4,dcim.site,"{OBJECT_CREATED},{OBJECT_UPDATED}",webhook,Webhook 1', ) diff --git a/netbox/ipam/api/nested_serializers.py b/netbox/ipam/api/nested_serializers.py index 57a1a65d5..8b10f29df 100644 --- a/netbox/ipam/api/nested_serializers.py +++ b/netbox/ipam/api/nested_serializers.py @@ -30,7 +30,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/ipam/api/views.py b/netbox/ipam/api/views.py index cac90bb87..d39d50622 100644 --- a/netbox/ipam/api/views.py +++ b/netbox/ipam/api/views.py @@ -250,7 +250,7 @@ class AvailableObjectsView(ObjectValidationMixin, APIView): # Determine if the requested number of objects is available if not self.check_sufficient_available(serializer.validated_data, available_objects): return Response( - {"detail": f"Insufficient resources are available to satisfy the request"}, + {"detail": "Insufficient resources are available to satisfy the request"}, status=status.HTTP_409_CONFLICT ) diff --git a/netbox/ipam/tests/test_views.py b/netbox/ipam/tests/test_views.py index 2acb80ac1..95b311878 100644 --- a/netbox/ipam/tests/test_views.py +++ b/netbox/ipam/tests/test_views.py @@ -50,7 +50,7 @@ class ASNRangeTestCase(ViewTestCases.PrimaryObjectViewTestCase): } cls.csv_data = ( - f"name,slug,rir,tenant,start,end,description", + "name,slug,rir,tenant,start,end,description", f"ASN Range 4,asn-range-4,{rirs[1].name},{tenants[1].name},400,499,Fourth range", f"ASN Range 5,asn-range-5,{rirs[1].name},{tenants[1].name},500,599,Fifth range", f"ASN Range 6,asn-range-6,{rirs[1].name},{tenants[1].name},600,699,Sixth range", @@ -770,14 +770,14 @@ class VLANGroupTestCase(ViewTestCases.OrganizationalObjectViewTestCase): } cls.csv_data = ( - f"name,slug,scope_type,scope_id,description", - f"VLAN Group 4,vlan-group-4,,,Fourth VLAN group", + "name,slug,scope_type,scope_id,description", + "VLAN Group 4,vlan-group-4,,,Fourth VLAN group", f"VLAN Group 5,vlan-group-5,dcim.site,{sites[0].pk},Fifth VLAN group", f"VLAN Group 6,vlan-group-6,dcim.site,{sites[1].pk},Sixth VLAN group", ) cls.csv_update_data = ( - f"id,name,description", + "id,name,description", f"{vlan_groups[0].pk},VLAN Group 7,Fourth VLAN group7", f"{vlan_groups[1].pk},VLAN Group 8,Fifth VLAN group8", f"{vlan_groups[2].pk},VLAN Group 9,Sixth VLAN group9", diff --git a/netbox/netbox/config/__init__.py b/netbox/netbox/config/__init__.py index 1c16d6769..23108f1d2 100644 --- a/netbox/netbox/config/__init__.py +++ b/netbox/netbox/config/__init__.py @@ -85,7 +85,7 @@ class Config: logger.debug("Loaded configuration data from database") except DatabaseError: # The database may not be available yet (e.g. when running a management command) - logger.warning(f"Skipping config initialization (database unavailable)") + logger.warning("Skipping config initialization (database unavailable)") return revision.activate() diff --git a/netbox/netbox/navigation/menu.py b/netbox/netbox/navigation/menu.py index a1d65d6e2..9d8ffaaf8 100644 --- a/netbox/netbox/navigation/menu.py +++ b/netbox/netbox/navigation/menu.py @@ -386,57 +386,57 @@ ADMIN_MENU = Menu( label=_('Authentication'), items=( MenuItem( - link=f'users:user_list', + link='users:user_list', link_text=_('Users'), auth_required=True, - permissions=[f'users.view_user'], + permissions=['users.view_user'], buttons=( MenuItemButton( - link=f'users:user_add', + link='users:user_add', title='Add', icon_class='mdi mdi-plus-thick', - permissions=[f'users.add_user'] + permissions=['users.add_user'] ), MenuItemButton( - link=f'users:user_import', + link='users:user_import', title='Import', icon_class='mdi mdi-upload', - permissions=[f'users.add_user'] + permissions=['users.add_user'] ) ) ), MenuItem( - link=f'users:group_list', + link='users:group_list', link_text=_('Groups'), auth_required=True, - permissions=[f'users.view_group'], + permissions=['users.view_group'], buttons=( MenuItemButton( - link=f'users:group_add', + link='users:group_add', title='Add', icon_class='mdi mdi-plus-thick', - permissions=[f'users.add_group'] + permissions=['users.add_group'] ), MenuItemButton( - link=f'users:group_import', + link='users:group_import', title='Import', icon_class='mdi mdi-upload', - permissions=[f'users.add_group'] + permissions=['users.add_group'] ) ) ), MenuItem( - link=f'users:token_list', + link='users:token_list', link_text=_('API Tokens'), auth_required=True, - permissions=[f'users.view_token'], + permissions=['users.view_token'], buttons=get_model_buttons('users', 'token') ), MenuItem( - link=f'users:objectpermission_list', + link='users:objectpermission_list', link_text=_('Permissions'), auth_required=True, - permissions=[f'users.view_objectpermission'], + permissions=['users.view_objectpermission'], buttons=get_model_buttons('users', 'objectpermission', actions=['add']) ), ), diff --git a/netbox/netbox/staging.py b/netbox/netbox/staging.py index 4d37fb7ad..e6b946403 100644 --- a/netbox/netbox/staging.py +++ b/netbox/netbox/staging.py @@ -80,7 +80,7 @@ class checkout: Create Change instances for all actions stored in the queue. """ if not self.queue: - logger.debug(f"No queued changes; aborting") + logger.debug("No queued changes; aborting") return logger.debug(f"Processing {len(self.queue)} queued changes") diff --git a/netbox/netbox/tests/dummy_plugin/views.py b/netbox/netbox/tests/dummy_plugin/views.py index c4d80731f..82f250fc1 100644 --- a/netbox/netbox/tests/dummy_plugin/views.py +++ b/netbox/netbox/tests/dummy_plugin/views.py @@ -21,7 +21,7 @@ class DummyModelsView(View): class DummyModelAddView(View): def get(self, request): - return HttpResponse(f"Create an instance") + return HttpResponse("Create an instance") def post(self, request): instance = DummyModel( @@ -29,7 +29,7 @@ class DummyModelAddView(View): number=random.randint(1, 100000) ) instance.save() - return HttpResponse(f"Instance created") + return HttpResponse("Instance created") @register_model_view(Site, 'extra', path='other-stuff') diff --git a/netbox/tenancy/api/nested_serializers.py b/netbox/tenancy/api/nested_serializers.py index 5f339ecba..5adb78863 100644 --- a/netbox/tenancy/api/nested_serializers.py +++ b/netbox/tenancy/api/nested_serializers.py @@ -15,7 +15,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/users/api/nested_serializers.py b/netbox/users/api/nested_serializers.py index 2a5763476..201e38901 100644 --- a/netbox/users/api/nested_serializers.py +++ b/netbox/users/api/nested_serializers.py @@ -18,7 +18,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/users/api/views.py b/netbox/users/api/views.py index 240f68d36..bba9a4ec3 100644 --- a/netbox/users/api/views.py +++ b/netbox/users/api/views.py @@ -73,7 +73,7 @@ class TokenProvisionView(APIView): def perform_create(self, serializer): model = serializer.Meta.model - logger = logging.getLogger(f'netbox.api.views.TokenProvisionView') + logger = logging.getLogger('netbox.api.views.TokenProvisionView') logger.info(f"Creating new {model._meta.verbose_name}") serializer.save() diff --git a/netbox/users/tests/test_preferences.py b/netbox/users/tests/test_preferences.py index b5037ec3f..13120d328 100644 --- a/netbox/users/tests/test_preferences.py +++ b/netbox/users/tests/test_preferences.py @@ -51,11 +51,11 @@ class UserPreferencesTest(TestCase): # Check that table ordering preference has been recorded self.user.refresh_from_db() - ordering = self.user.config.get(f'tables.SiteTable.ordering') + ordering = self.user.config.get('tables.SiteTable.ordering') self.assertEqual(ordering, ['status']) # Check that a recorded preference is honored by default - self.user.config.set(f'tables.SiteTable.ordering', ['-status'], commit=True) + self.user.config.set('tables.SiteTable.ordering', ['-status'], commit=True) table = SiteTable(Site.objects.all()) request = RequestFactory().get(url) request.user = self.user diff --git a/netbox/utilities/tests/test_api.py b/netbox/utilities/tests/test_api.py index 81be70a34..ba0c3c4f8 100644 --- a/netbox/utilities/tests/test_api.py +++ b/netbox/utilities/tests/test_api.py @@ -149,7 +149,7 @@ class APIPaginationTestCase(APITestCase): self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(response.data['count'], 100) - self.assertTrue(response.data['next'].endswith(f'?limit=10&offset=10')) + self.assertTrue(response.data['next'].endswith('?limit=10&offset=10')) self.assertIsNone(response.data['previous']) self.assertEqual(len(response.data['results']), 10) @@ -159,7 +159,7 @@ class APIPaginationTestCase(APITestCase): self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(response.data['count'], 100) - self.assertTrue(response.data['next'].endswith(f'?limit=20&offset=20')) + self.assertTrue(response.data['next'].endswith('?limit=20&offset=20')) self.assertIsNone(response.data['previous']) self.assertEqual(len(response.data['results']), 20) diff --git a/netbox/virtualization/api/nested_serializers.py b/netbox/virtualization/api/nested_serializers.py index a2395faa5..59016f74d 100644 --- a/netbox/virtualization/api/nested_serializers.py +++ b/netbox/virtualization/api/nested_serializers.py @@ -18,7 +18,7 @@ __all__ = [ # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/virtualization/tests/test_views.py b/netbox/virtualization/tests/test_views.py index 0daa55a5c..3c6a058c9 100644 --- a/netbox/virtualization/tests/test_views.py +++ b/netbox/virtualization/tests/test_views.py @@ -354,14 +354,14 @@ class VMInterfaceTestCase(ViewTestCases.DeviceComponentViewTestCase): } cls.csv_data = ( - f"virtual_machine,name,vrf.pk", + "virtual_machine,name,vrf.pk", f"Virtual Machine 2,Interface 4,{vrfs[0].pk}", f"Virtual Machine 2,Interface 5,{vrfs[0].pk}", f"Virtual Machine 2,Interface 6,{vrfs[0].pk}", ) cls.csv_update_data = ( - f"id,name,description", + "id,name,description", f"{interfaces[0].pk},Interface 7,New description 7", f"{interfaces[1].pk},Interface 8,New description 8", f"{interfaces[2].pk},Interface 9,New description 9", @@ -438,14 +438,14 @@ class VirtualDiskTestCase(ViewTestCases.DeviceComponentViewTestCase): } cls.csv_data = ( - f"virtual_machine,name,size,description", - f"Virtual Machine 1,Disk 4,20,Fourth", - f"Virtual Machine 1,Disk 5,20,Fifth", - f"Virtual Machine 1,Disk 6,20,Sixth", + "virtual_machine,name,size,description", + "Virtual Machine 1,Disk 4,20,Fourth", + "Virtual Machine 1,Disk 5,20,Fifth", + "Virtual Machine 1,Disk 6,20,Sixth", ) cls.csv_update_data = ( - f"id,name,size", + "id,name,size", f"{disks[0].pk},disk1,20", f"{disks[1].pk},disk2,20", f"{disks[2].pk},disk3,20", diff --git a/netbox/virtualization/views.py b/netbox/virtualization/views.py index ad3487b8b..0828d3a2a 100644 --- a/netbox/virtualization/views.py +++ b/netbox/virtualization/views.py @@ -657,7 +657,7 @@ class VirtualMachineBulkAddInterfaceView(generic.BulkComponentCreateView): default_return_url = 'virtualization:virtualmachine_list' def get_required_permission(self): - return f'virtualization.add_vminterface' + return 'virtualization.add_vminterface' class VirtualMachineBulkAddVirtualDiskView(generic.BulkComponentCreateView): @@ -671,4 +671,4 @@ class VirtualMachineBulkAddVirtualDiskView(generic.BulkComponentCreateView): default_return_url = 'virtualization:virtualmachine_list' def get_required_permission(self): - return f'virtualization.add_virtualdisk' + return 'virtualization.add_virtualdisk' diff --git a/netbox/vpn/api/nested_serializers.py b/netbox/vpn/api/nested_serializers.py index c1a90cbea..59e394c2e 100644 --- a/netbox/vpn/api/nested_serializers.py +++ b/netbox/vpn/api/nested_serializers.py @@ -21,7 +21,7 @@ __all__ = ( # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/vpn/tests/test_views.py b/netbox/vpn/tests/test_views.py index 105ca0b6f..05ac527fe 100644 --- a/netbox/vpn/tests/test_views.py +++ b/netbox/vpn/tests/test_views.py @@ -542,9 +542,9 @@ class IPSecProfileTestCase(ViewTestCases.PrimaryObjectViewTestCase): cls.csv_data = ( "name,mode,ike_policy,ipsec_policy", - f"IKE Proposal 4,ah,IKE Policy 2,IPSec Policy 2", - f"IKE Proposal 5,ah,IKE Policy 2,IPSec Policy 2", - f"IKE Proposal 6,ah,IKE Policy 2,IPSec Policy 2", + "IKE Proposal 4,ah,IKE Policy 2,IPSec Policy 2", + "IKE Proposal 5,ah,IKE Policy 2,IPSec Policy 2", + "IKE Proposal 6,ah,IKE Policy 2,IPSec Policy 2", ) cls.csv_update_data = ( @@ -661,7 +661,7 @@ class L2VPNTerminationTestCase( ) cls.csv_update_data = ( - f"id,l2vpn", + "id,l2vpn", f"{terminations[0].pk},{l2vpns[0].name}", f"{terminations[1].pk},{l2vpns[0].name}", f"{terminations[2].pk},{l2vpns[0].name}", diff --git a/netbox/wireless/api/nested_serializers.py b/netbox/wireless/api/nested_serializers.py index 433164e60..9b8b6c3e3 100644 --- a/netbox/wireless/api/nested_serializers.py +++ b/netbox/wireless/api/nested_serializers.py @@ -12,7 +12,7 @@ __all__ = ( # TODO: Remove in v4.2 warnings.warn( - f"Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", + "Dedicated nested serializers will be removed in NetBox v4.2. Use Serializer(nested=True) instead.", DeprecationWarning ) diff --git a/netbox/wireless/tests/test_views.py b/netbox/wireless/tests/test_views.py index 055edf73c..a4dc2aae5 100644 --- a/netbox/wireless/tests/test_views.py +++ b/netbox/wireless/tests/test_views.py @@ -102,14 +102,14 @@ class WirelessLANTestCase(ViewTestCases.PrimaryObjectViewTestCase): } cls.csv_data = ( - f"group,ssid,status,tenant", + "group,ssid,status,tenant", f"Wireless LAN Group 2,WLAN4,{WirelessLANStatusChoices.STATUS_ACTIVE},{tenants[0].name}", f"Wireless LAN Group 2,WLAN5,{WirelessLANStatusChoices.STATUS_DISABLED},{tenants[1].name}", f"Wireless LAN Group 2,WLAN6,{WirelessLANStatusChoices.STATUS_RESERVED},{tenants[2].name}", ) cls.csv_update_data = ( - f"id,ssid", + "id,ssid", f"{wireless_lans[0].pk},WLAN7", f"{wireless_lans[1].pk},WLAN8", f"{wireless_lans[2].pk},WLAN9", @@ -167,7 +167,7 @@ class WirelessLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase): } cls.csv_data = ( - f"interface_a,interface_b,status,tenant", + "interface_a,interface_b,status,tenant", f"{interfaces[6].pk},{interfaces[7].pk},connected,{tenants[0].name}", f"{interfaces[8].pk},{interfaces[9].pk},connected,{tenants[1].name}", f"{interfaces[10].pk},{interfaces[11].pk},connected,{tenants[2].name}",