Skip to content

Commit

Permalink
Attachment Viewset | Apply filtering in queryset attribute
Browse files Browse the repository at this point in the history
Remove filter_queryset method
  • Loading branch information
FrankApiyo committed Oct 23, 2024
1 parent 8f1cea4 commit cd9725c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions onadata/apps/api/viewsets/dataview_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DataViewViewSet(
A simple ViewSet for viewing and editing DataViews.
"""

queryset = DataView.objects.select_related()
queryset = DataView.objects.filter(deleted_at__isnull=True).select_related()
serializer_class = DataViewSerializer
permission_classes = [DataViewViewsetPermissions]
lookup_field = "pk"
Expand Down Expand Up @@ -155,12 +155,6 @@ def get_serializer_class(self):

return serializer_class

def filter_queryset(self, queryset):
"""
Remove deleted DataViews
"""
return super().filter_queryset(queryset.filter(deleted_at=None))

def list(self, request, *args, **kwargs):
"""
List endpoint for Filtered datasets
Expand Down

0 comments on commit cd9725c

Please sign in to comment.