From caed3812fea3d501c7df45e262751347edb3d9c5 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 6 May 2026 20:43:06 -0400 Subject: [PATCH] Remove backward compatibility shim for OptionalLimitOffsetPagination Removes the deprecated OptionalLimitOffsetPagination alias (renamed to NetBoxPagination in a prior release) per the v4.7.0 removal schedule. Closes #22052 Co-Authored-By: Claude Sonnet 4.6 --- netbox/netbox/api/pagination.py | 14 -------------- netbox/netbox/tests/test_api.py | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/netbox/netbox/api/pagination.py b/netbox/netbox/api/pagination.py index bbdc83256..eb0295662 100644 --- a/netbox/netbox/api/pagination.py +++ b/netbox/netbox/api/pagination.py @@ -1,5 +1,3 @@ -import warnings - from django.db.models import QuerySet from django.utils.translation import gettext_lazy as _ from rest_framework.exceptions import ValidationError @@ -222,15 +220,3 @@ class LimitOffsetListPagination(LimitOffsetPagination): self.display_page_controls = True return data[self.offset:self.offset + self.limit] - - -# TODO: Remove in NetBox v4.7.0 -def __getattr__(name): - if name == 'OptionalLimitOffsetPagination': - warnings.warn( - "OptionalLimitOffsetPagination has been renamed to NetBoxPagination. " - "OptionalLimitOffsetPagination will be removed in NetBox v4.7.0.", - DeprecationWarning, - ) - return NetBoxPagination - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/netbox/netbox/tests/test_api.py b/netbox/netbox/tests/test_api.py index 0cff906a4..2529e56cf 100644 --- a/netbox/netbox/tests/test_api.py +++ b/netbox/netbox/tests/test_api.py @@ -46,7 +46,7 @@ class AppTest(APITestCase): self.assertEqual(response.data['id'], self.user.pk) -class OptionalLimitOffsetPaginationTest(TestCase): +class NetBoxPaginationTest(TestCase): def setUp(self): self.paginator = NetBoxPagination()