Fix crash if a tax rule on a fee prevents sale (PRETIXEU-8MZ)

This commit is contained in:
Raphael Michel
2023-06-23 11:30:37 +02:00
parent 147061eaa4
commit cc7f249cb8
6 changed files with 109 additions and 23 deletions

View File

@@ -60,7 +60,7 @@ from pretix.base.channels import get_all_sales_channels
from pretix.base.forms import PlaceholderValidator
from pretix.base.models import (
CartPosition, Event, GiftCard, InvoiceAddress, Order, OrderPayment,
OrderRefund, Quota,
OrderRefund, Quota, TaxRule,
)
from pretix.base.reldate import RelativeDateField, RelativeDateWrapper
from pretix.base.settings import SettingsSandbox
@@ -1015,7 +1015,11 @@ class FreeOrderProvider(BasePaymentProvider):
cart = get_cart(request)
total = get_cart_total(request)
total += sum([f.value for f in get_fees(self.event, request, total, None, None, cart)])
try:
total += sum([f.value for f in get_fees(self.event, request, total, None, None, cart)])
except TaxRule.SaleNotAllowed:
# ignore for now, will fail on order creation
pass
return total == 0
def order_change_allowed(self, order: Order) -> bool: