split my distributions by archive (is_closed)
This commit is contained in:
@@ -117,6 +117,11 @@ class QuotaDistributionViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewS
|
|||||||
Q(assigned_organization=organization)
|
Q(assigned_organization=organization)
|
||||||
).order_by('-modify_date')
|
).order_by('-modify_date')
|
||||||
|
|
||||||
|
if query.get('archive') and query.get('archive') == 'true':
|
||||||
|
queryset = queryset.filter(Q(quota__is_closed=True))
|
||||||
|
else:
|
||||||
|
queryset = queryset.filter(Q(quota__is_closed=False))
|
||||||
|
|
||||||
page = self.paginate_queryset(queryset)
|
page = self.paginate_queryset(queryset)
|
||||||
if page is not None: # noqa
|
if page is not None: # noqa
|
||||||
serializer = self.get_serializer(page, many=True) # noqa
|
serializer = self.get_serializer(page, many=True) # noqa
|
||||||
|
|||||||
Reference in New Issue
Block a user