Use more sensible defaults for check-in lists in event series (#3147)

This commit is contained in:
Raphael Michel
2023-03-14 22:26:40 +01:00
committed by GitHub
parent 136511f394
commit 859004ec59
6 changed files with 35 additions and 7 deletions

View File

@@ -55,7 +55,12 @@ class CheckinList(LoggedModel):
all_products = models.BooleanField(default=True, verbose_name=_("All products (including newly created ones)"))
limit_products = models.ManyToManyField('Item', verbose_name=_("Limit to products"), blank=True)
subevent = models.ForeignKey('SubEvent', null=True, blank=True,
verbose_name=pgettext_lazy('subevent', 'Date'), on_delete=models.CASCADE)
verbose_name=pgettext_lazy('subevent', 'Date'),
on_delete=models.CASCADE,
help_text=_('If you choose "all dates", tickets will be considered part of this list '
'and valid for check-in regardless of which date they are purchased for. '
'You can limit their validity through the advanced check-in rules, '
'though.'))
include_pending = models.BooleanField(verbose_name=pgettext_lazy('checkin', 'Include pending orders'),
default=False,
help_text=_('With this option, people will be able to check in even if the '

View File

@@ -985,7 +985,7 @@ class Order(LockModel, LoggedModel):
context: Dict[str, Any]=None, log_entry_type: str='pretix.event.order.email.sent',
user: User=None, headers: dict=None, sender: str=None, invoices: list=None,
auth=None, attach_tickets=False, position: 'OrderPosition'=None, auto_email=True,
attach_ical=False, attach_cached_files: list=None, attach_other_files: list=None):
attach_ical=False, attach_other_files: list=None, attach_cached_files: list=None):
"""
Sends an email to the user that placed this order. Basically, this method does two things:

View File

@@ -515,6 +515,16 @@
</fieldset>
<fieldset>
<legend>{% trans "Check-in lists" %}</legend>
<p class="help-block">
{% blocktrans trimmed %}
You can choose to either add one or more check-in lists for every date in your series individually,
or use just one check-in list for all your dates and limit admission through check-in rules. Which
approach is better depends on multiple factors, such as the number of dates in your series. For a
series with one or less event date per day, individual lists are usually more helpful. If you
use dates to represent many time slots on the same day, or even overlapping time slots, working with
just one large check-in list will be easier.
{% endblocktrans %}
</p>
<div class="formset" data-formset data-formset-prefix="{{ cl_formset.prefix }}">
{{ cl_formset.management_form }}
{% bootstrap_formset_errors cl_formset %}

View File

@@ -157,6 +157,16 @@
</fieldset>
<fieldset>
<legend>{% trans "Check-in lists" %}</legend>
<p class="help-block">
{% blocktrans trimmed %}
You can choose to either add one or more check-in lists for every date in your series individually,
or use just one check-in list for all your dates and limit admission through check-in rules. Which
approach is better depends on multiple factors, such as the number of dates in your series. For a
series with one or less event date per day, individual lists are usually more helpful. If you
use dates to represent many time slots on the same day, or even overlapping time slots, working with
just one large check-in list will be easier.
{% endblocktrans %}
</p>
<div class="formset" data-formset data-formset-prefix="{{ cl_formset.prefix }}">
{{ cl_formset.management_form }}
{% bootstrap_formset_errors cl_formset %}

View File

@@ -306,10 +306,11 @@ class EventWizard(SafeSessionWizardView):
event.set_active_plugins(settings.PRETIX_PLUGINS_DEFAULT.split(","),
allow_restricted=settings.PRETIX_PLUGINS_DEFAULT.split(","))
event.save(update_fields=['plugins'])
event.checkin_lists.create(
name=_('Default'),
all_products=True
)
if not event.has_subevents:
event.checkin_lists.create(
name=_('Default'),
all_products=True
)
event.set_defaults()
if basics_data['tax_rate']:

View File

@@ -251,7 +251,9 @@ class SubEventEditorMixin(MetaDataEditorMixin):
'include_pending': False,
}
]
extra = 0
if not self.request.event.checkin_lists.filter(subevent__isnull=True).exists():
extra = 1
formsetclass = inlineformset_factory(
SubEvent, CheckinList,