mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Do not allow vouchers to create negative prices
This commit is contained in:
@@ -251,7 +251,7 @@ class Voucher(LoggedModel):
|
||||
if self.price_mode == 'set':
|
||||
return self.value
|
||||
elif self.price_mode == 'subtract':
|
||||
return original_price - self.value
|
||||
return max(original_price - self.value, Decimal('0.00'))
|
||||
elif self.price_mode == 'percent':
|
||||
return round_decimal(original_price * (Decimal('100.00') - self.value) / Decimal('100.00'))
|
||||
return original_price
|
||||
|
||||
Reference in New Issue
Block a user