From 24a5208b804d979df0146ecfb978c9c459d36294 Mon Sep 17 00:00:00 2001 From: FrankApiyo Date: Thu, 29 Aug 2024 13:07:57 +0300 Subject: [PATCH] Add throttle scopes for xform_list and xform_submission viewsets --- onadata/apps/api/viewsets/xform_list_viewset.py | 1 + onadata/apps/api/viewsets/xform_submission_viewset.py | 1 + 2 files changed, 2 insertions(+) diff --git a/onadata/apps/api/viewsets/xform_list_viewset.py b/onadata/apps/api/viewsets/xform_list_viewset.py index a602cfb69f..a7abcb2dd0 100644 --- a/onadata/apps/api/viewsets/xform_list_viewset.py +++ b/onadata/apps/api/viewsets/xform_list_viewset.py @@ -68,6 +68,7 @@ class XFormListViewSet(ETagsMixin, BaseViewset, viewsets.ReadOnlyModelViewSet): renderer_classes = (XFormListRenderer,) serializer_class = XFormListSerializer template_name = "api/xformsList.xml" + throttle_scope = "xformlist" def get_object(self): queryset = self.filter_queryset(self.get_queryset()) diff --git a/onadata/apps/api/viewsets/xform_submission_viewset.py b/onadata/apps/api/viewsets/xform_submission_viewset.py index df1629ebb7..930998a01f 100644 --- a/onadata/apps/api/viewsets/xform_submission_viewset.py +++ b/onadata/apps/api/viewsets/xform_submission_viewset.py @@ -78,6 +78,7 @@ class XFormSubmissionViewSet( serializer_class = SubmissionSerializer template_name = "submission.xml" parser_classes = (FLOIPParser, JSONParser, FormParser, MultiPartParser) + throttle_scope = "submission" def get_serializer(self, *args, **kwargs): """