Compare commits

..

1 Commits

Author SHA1 Message Date
Raphael Michel
dfc80adb28 Vouchers: Fix ield label inconsistency (Z#23222887)
The field Voucher.price_mode is sometimes called "Price mode" and
sometimes "Price effect" in the UI, which is inconsistent. I think
"price effect" is a little clearer, but I don't really care as long as
it is consistent.
2026-02-17 09:33:43 +01:00
5 changed files with 6 additions and 11 deletions

View File

@@ -148,10 +148,6 @@ class NumberedCanvas(Canvas):
self.restoreState()
class InvoiceNotReadyException(Exception):
pass
class BaseInvoiceRenderer:
"""
This is the base class for all invoice renderers.

View File

@@ -132,7 +132,7 @@ class AllowIgnoreQuotaColumn(BooleanColumnMixin, ImportColumn):
class PriceModeColumn(ImportColumn):
identifier = 'price_mode'
verbose_name = gettext_lazy('Price mode')
verbose_name = gettext_lazy('Price effect')
default_value = None
initial = 'static:none'
@@ -147,7 +147,7 @@ class PriceModeColumn(ImportColumn):
elif value in reverse:
return reverse[value]
else:
raise ValidationError(_("Could not parse {value} as a price mode, use one of {options}.").format(
raise ValidationError(_("Could not parse {value} as a price effect, use one of {options}.").format(
value=value, options=', '.join(d.keys())
))
@@ -162,7 +162,7 @@ class ValueColumn(DecimalColumnMixin, ImportColumn):
def clean(self, value, previous_values):
value = super().clean(value, previous_values)
if value and previous_values.get("price_mode") == "none":
raise ValidationError(_("It is pointless to set a value without a price mode."))
raise ValidationError(_("It is pointless to set a value without a price effect."))
return value
def assign(self, value, obj: Voucher, **kwargs):

View File

@@ -239,7 +239,7 @@ class Voucher(LoggedModel):
)
)
price_mode = models.CharField(
verbose_name=_("Price mode"),
verbose_name=_("Price effect"),
max_length=100,
choices=PRICE_MODES,
default='none'

View File

@@ -51,7 +51,6 @@ from django_scopes import scope, scopes_disabled
from i18nfield.strings import LazyI18nString
from pretix.base.i18n import language
from pretix.base.invoicing.pdf import InvoiceNotReadyException
from pretix.base.invoicing.transmission import (
get_transmission_types, transmission_providers,
)
@@ -505,7 +504,7 @@ def generate_invoice(order: Order, trigger_pdf=True):
return invoice
@app.task(base=TransactionAwareTask, throws=(InvoiceNotReadyException,))
@app.task(base=TransactionAwareTask)
def invoice_pdf_task(invoice: int):
with scopes_disabled():
i = Invoice.objects.get(pk=invoice)

View File

@@ -170,7 +170,7 @@ def test_price_mode_validation(event, item, user):
import_vouchers.apply(
args=(event.pk, inputfile_factory().id, settings, 'en', user.pk)
).get()
assert 'It is pointless to set a value without a price mode.' in str(excinfo.value)
assert 'It is pointless to set a value without a price effect.' in str(excinfo.value)
settings['price_mode'] = 'static:percent'
import_vouchers.apply(