diff --git a/config/settings/base.py b/config/settings/base.py index bd31cfe98b..9755ac871c 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -460,7 +460,7 @@ def safe_key() -> str: ], 'DEFAULT_THROTTLE_RATES': { 'anon': '4/second', - 'user': '4/second' + 'user': '4/second', } } diff --git a/metadeploy/adminapi/api.py b/metadeploy/adminapi/api.py index 35981319ca..2e42eadaf4 100644 --- a/metadeploy/adminapi/api.py +++ b/metadeploy/adminapi/api.py @@ -138,6 +138,7 @@ class Meta: class PlanTemplateViewSet(AdminAPIViewSet): model_name = "PlanTemplate" serializer_base = PlanTemplateSerializer + throttle_classes = [] class PlanFilter(filters.FilterSet): @@ -150,22 +151,27 @@ class PlanViewSet(AdminAPIViewSet): model_name = "Plan" serializer_base = PlanSerializer filterset_class = PlanFilter + throttle_classes = [] class PlanSlugViewSet(AdminAPIViewSet): model_name = "PlanSlug" + throttle_classes = [] class VersionViewSet(AdminAPIViewSet): model_name = "Version" + throttle_classes = [] class ProductCategoryViewSet(AdminAPIViewSet): model_name = "ProductCategory" + throttle_classes = [] class AllowedListViewSet(AdminAPIViewSet): model_name = "AllowedList" + throttle_classes = [] class AllowedListOrgSerializer(AdminAPISerializer): @@ -175,6 +181,7 @@ class AllowedListOrgSerializer(AdminAPISerializer): class AllowedListOrgViewSet(AdminAPIViewSet): model_name = "AllowedListOrg" serializer_base = AllowedListOrgSerializer + throttle_classes = [] class TranslationViewSet(viewsets.ViewSet): @@ -194,6 +201,7 @@ class TranslationViewSet(viewsets.ViewSet): permission_classes = [IsAPIUser] model_name = "Translation" + throttle_classes = [] def partial_update(self, request, pk=None): # Add or update a Translation record for each message diff --git a/metadeploy/adminapi/tests/test_api.py b/metadeploy/adminapi/tests/test_api.py index 6244fa023e..bc28d1f7d5 100644 --- a/metadeploy/adminapi/tests/test_api.py +++ b/metadeploy/adminapi/tests/test_api.py @@ -86,6 +86,14 @@ def test_list(self, admin_api_client, plan_factory): "meta": {"page": {"total": 1}}, } + def test_throttle(self, admin_api_client): + url = "http://testserver/admin/rest/allowedlistorgs" + for i in range(0, 4): + response = admin_api_client.get(url) + + response = admin_api_client.get(url) + assert response.status_code == 200 + def test_retrieve(self, admin_api_client, step_factory): step = step_factory() plan = step.plan