Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add throttle scopes for xform_list and xform_submission viewsets #2685

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions onadata/apps/api/viewsets/xform_list_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
1 change: 1 addition & 0 deletions onadata/apps/api/viewsets/xform_submission_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down