Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix voucher with usage limit zero
fowczarek466e8675d7d1
diff --git a/saleor/discount/models.py b/saleor/discount/models.pyindex d7a2eca496..a3d3649b34 100644--- a/saleor/discount/models.py+++ b/saleor/discount/models.py@@ -33,7 +33,9 @@ class NotApplicable(ValueError):class VoucherQueryset(models.QuerySet):def active(self, date):return self.filter(- Q(usage_limit__isnull=True) | Q(used__lt=F("usage_limit")),+ Q(usage_limit__isnull=True)+ | Q(used__lt=F("usage_limit"))+ | Q(usage_limit=0),Q(end_date__isnull=True) | Q(end_date__gte=date),start_date__lte=date,)