Commit 107327be authored by HEVELINE Thomas's avatar HEVELINE Thomas Committed by HEVELINE Thomas

(44): fix filtering

parent 29515baf
......@@ -532,14 +532,16 @@ class DeliveryView(PermissionRequiredMixin, ListView):
itemList = itemList.filter(beeing_delivered=beeing_delivered)
paid = self.boolQueryParam(request.GET["paid"])
if paid is not None: itemList = itemList.filter(order__payment__paid=paid)
itemList = itemList.filter(Q(item__name__icontains=request.GET["productContains"])
& Q(customization__icontains=request.GET["customizationContains"]))
if paid is True:
itemList = itemList.filter(order__payment__paid=True)
elif paid is False:
itemList = itemList.filter(Q(order__payment__isnull=True) | Q(order__payment__paid=False))
itemList = itemList.filter(Q(item__name__icontains=request.GET["productContains"])
& Q(customization__icontains=request.GET["customizationContains"])
& Q(order__user__email__icontains=request.GET["emailContains"]))
optionContains = request.GET["optionContains"]
print(optionContains)
if optionContains != "":
itemList = itemList.filter(Q(option__iexact=optionContains) | Q(second_option__iexact=optionContains))
......@@ -651,7 +653,7 @@ class DeliveryView(PermissionRequiredMixin, ListView):
orderitem.quantity_delivered += quantity
orderitem.save()
notify(
"Le {} vous à été remis".format(orderitem.item),
"{} {} vous à été remis".format(quantity, orderitem.item),
"boutique:index",
users=User.objects.filter(username=orderitem.order.user),
)
......
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