fix - dashboard quota filter by date
This commit is contained in:
@@ -441,7 +441,8 @@ class QuotaViewSet(BaseViewSet, SoftDeleteMixin, QuotaDashboardService, viewsets
|
||||
|
||||
queryset = self.filter_query(
|
||||
self.get_queryset(visibility_by_org_scope=True).filter(
|
||||
is_closed=False)) # return by search param or all objects
|
||||
is_closed=False)
|
||||
) # return by search param or all objects
|
||||
|
||||
# paginate queryset
|
||||
page = self.paginate_queryset(
|
||||
|
||||
@@ -134,6 +134,9 @@ class QuotaDistributionViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewS
|
||||
else:
|
||||
queryset = queryset.filter(Q(quota__is_closed=False))
|
||||
|
||||
if query.get('product_id'):
|
||||
queryset = queryset.filter(Q(quota__product_id=int(query.get('product_id'))))
|
||||
|
||||
queryset = self.filter_query(self.filter_queryset(queryset))
|
||||
|
||||
page = self.paginate_queryset(queryset)
|
||||
|
||||
Reference in New Issue
Block a user