diff --git a/crm/views/product_views.py b/crm/views/product_views.py index 0fe9b6a..1febad8 100644 --- a/crm/views/product_views.py +++ b/crm/views/product_views.py @@ -18,7 +18,11 @@ def log_product_action(admin, action, product_id, details): @api_view(['GET']) @permission_classes([IsCRMAdmin]) def list_products(request): - products = Product.objects.all() + include_deleted = request.query_params.get('include_deleted') + if include_deleted == 'true': + products = Product.objects.all() + else: + products = Product.objects.filter(is_active=True) product_status = request.query_params.get('status') if product_status: