Merge branch 'master' into questions-vue3

# Conflicts:
#	.github/workflows/tests.yml
#	.gitignore
#	Dockerfile
#	package-lock.json
#	package.json
#	src/pretix/base/management/commands/runserver.py
#	src/pretix/base/middleware.py
#	src/pretix/base/templatetags/vite.py
#	src/pretix/control/forms/global_settings.py
#	src/pretix/control/templates/pretixcontrol/checkin/list_edit.html
#	src/pretix/control/views/item.py
#	src/pretix/presale/views/widget.py
#	src/pretix/settings.py
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/App.vue
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/constants.ts
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/django-interop.ts
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/lookup-select2.vue
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/timefield.vue
#	src/pretix/static/pretixcontrol/js/ui/checkinrules/viz-node.vue
#	src/pretix/static/pretixpresale/widget/index.html
#	src/pretix/static/pretixpresale/widget/src/api.ts
#	src/pretix/static/pretixpresale/widget/src/button.ts
#	src/pretix/static/pretixpresale/widget/src/components/PriceBox.vue
#	src/pretix/static/pretixpresale/widget/src/main.ts
#	src/pretix/static/pretixpresale/widget/src/sharedStore.ts
#	src/pretix/static/pretixpresale/widget/src/utils.ts
#	src/pretix/static/pretixpresale/widget/src/widget.ts
#	src/tests/e2e/conftest.py
#	vite.config.ts
This commit is contained in:
Mira Weller
2026-06-17 12:24:49 +02:00
344 changed files with 157817 additions and 151255 deletions
+23 -6
View File
@@ -452,11 +452,16 @@ class Item(LoggedModel):
MEDIA_POLICY_REUSE = 'reuse'
MEDIA_POLICY_NEW = 'new'
MEDIA_POLICY_REUSE_OR_NEW = 'reuse_or_new'
MEDIA_POLICY_APPEND = 'append'
MEDIA_POLICY_APPEND_OR_NEW = 'append_or_new'
MEDIA_POLICIES = (
(None, _("Don't use re-usable media, use regular one-off tickets")),
(MEDIA_POLICY_REUSE, _('Require an existing medium to be re-used')),
(None, _("Don't use reusable media, use regular one-off tickets")),
(MEDIA_POLICY_NEW, _('Require a previously unknown medium to be newly added')),
(MEDIA_POLICY_REUSE_OR_NEW, _('Require either an existing or a new medium to be used')),
(MEDIA_POLICY_REUSE, _('Require an existing medium to be reused, replacing any previous tickets')),
(MEDIA_POLICY_REUSE_OR_NEW, _('Require either an existing or a new medium to be used, replacing any previous tickets')),
(MEDIA_POLICY_APPEND, _('Require an existing medium to be reused, adding to any previous tickets')),
(MEDIA_POLICY_APPEND_OR_NEW,
_('Require either an existing or a new medium to be used, adding to any previous tickets')),
)
objects = ItemQuerySetManager()
@@ -769,7 +774,7 @@ class Item(LoggedModel):
null=True, blank=True, max_length=16,
verbose_name=_('Reusable media policy'),
help_text=_(
'If this product should be stored on a re-usable physical medium, you can attach a physical media policy. '
'If this product should be stored on a reusable physical medium, you can attach a physical media policy. '
'This is not required for regular tickets, which just use a one-time barcode, but only for products like '
'renewable season tickets or re-chargeable gift card wristbands. '
'This is an advanced feature that also requires specific configuration of ticketing and printing settings.'
@@ -778,7 +783,7 @@ class Item(LoggedModel):
media_type = models.CharField(
max_length=100,
null=True, blank=True,
choices=[(None, _("Don't use re-usable media, use regular one-off tickets"))] + [(k, v) for k, v in MEDIA_TYPES.items()],
choices=[(None, _("Don't use reusable media, use regular one-off tickets"))] + [(k, v) for k, v in MEDIA_TYPES.items()],
verbose_name=_('Reusable media type'),
help_text=_(
'Select the type of physical medium that should be used for this product. Note that not all media types '
@@ -995,6 +1000,11 @@ class Item(LoggedModel):
raise ValidationError(_('The selected media type does not support usage for tickets currently.'))
if not mt.supports_giftcard and issue_giftcard:
raise ValidationError(_('The selected media type does not support usage for gift cards currently.'))
if media_policy in (Item.MEDIA_POLICY_NEW, Item.MEDIA_POLICY_APPEND_OR_NEW, Item.MEDIA_POLICY_REUSE_OR_NEW):
if not mt.medium_created_by_server and not mt.medium_created_from_unknown_supported:
raise ValidationError(_('The selected media type requires all media to be registered in the system '
'prior to their usage. Therefore, the selected media policy does not make '
'sense for this media type.'))
if issue_giftcard:
raise ValidationError(_('You currently cannot create gift cards with a reusable media policy. Instead, '
'gift cards for some reusable media types can be created or re-charged directly '
@@ -2321,7 +2331,7 @@ class Quota(LoggedModel):
class ItemMetaProperty(LoggedModel):
"""
An event can have ItemMetaProperty objects attached to define meta information fields
for its items. This information can be re-used for example in ticket layouts.
for its items. This information can be reused for example in ticket layouts.
:param event: The event this property is defined for.
:type event: Event
@@ -2407,10 +2417,17 @@ class ItemProgramTime(models.Model):
:type start: datetime
:param end: The date and time this program time ends
:type end: datetime
:param location: venue
:type location: str
"""
item = models.ForeignKey('Item', related_name='program_times', on_delete=models.CASCADE)
start = models.DateTimeField(verbose_name=_("Start"))
end = models.DateTimeField(verbose_name=_("End"))
location = I18nTextField(
null=True, blank=True,
max_length=200,
verbose_name=_("Location"),
)
def clean(self):
if hasattr(self, 'item') and self.item and self.item.event.has_subevents: