Filtered unsuccessful orderitems on customer views

parent ab6bc4ae
......@@ -59,7 +59,7 @@ def customer_details(request, customer_id):
start_date = request.GET.get('start-date', '2000-01-01')
end_date = request.GET.get('end-date', '2100-01-01')
order_list = Order.objects.filter(customer_id__in=customer_list, order_date__range=[start_date, end_date])
order_item_list = OrderItem.objects.filter(order_no__in=order_list)
order_item_list = OrderItem.objects.filter(order_no__in=order_list, is_successful=True)
return render(request, "users/customer_details.html",{"customer": customer, "order_list":order_list, "order_item_list":order_item_list})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment