mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Auto-check-in for specific sales channels (#1409)
* Autocheckin data model/cosmetics * Expose automatically checked-in OrderPositions * Expose automatically checked-in OrderPositions in CSV/PDF Exports * Fix some tests, try to fix MultiStringField/CheckboxSelectMultiple * Actually fix MultiStringField/CheckboxSelectMultiple. (Not pretty, but it works) * Fix more tests * Squash migration * Also fix CSV/nameparts-test * Changes for Autocheckin code-review * Perform Auto-Checkins through new core plugin * Update config-doc to reflect also checkinlists * Explicitly output AutoCheckin Yes/No for CSV-Export (+ fix test) * Move autocheckin from plugin to service * API-doc * Fix API-doc spelling * Checkinlist-API and autocheckin order tests * Performance improvement when reading checkinlists for autocheckin Co-Authored-By: Raphael Michel <michel@rami.io> * Autocheckin test for order created through API * Resolve migration conflict
This commit is contained in:
committed by
Raphael Michel
parent
05a1df244b
commit
748a389acb
@@ -5,6 +5,7 @@ from django_scopes.forms import (
|
||||
SafeModelChoiceField, SafeModelMultipleChoiceField,
|
||||
)
|
||||
|
||||
from pretix.base.channels import get_all_sales_channels
|
||||
from pretix.base.models.checkin import CheckinList
|
||||
from pretix.control.forms.widgets import Select2
|
||||
|
||||
@@ -15,6 +16,16 @@ class CheckinListForm(forms.ModelForm):
|
||||
kwargs.pop('locales', None)
|
||||
super().__init__(**kwargs)
|
||||
self.fields['limit_products'].queryset = self.event.items.all()
|
||||
self.fields['auto_checkin_sales_channels'] = forms.MultipleChoiceField(
|
||||
label=self.fields['auto_checkin_sales_channels'].label,
|
||||
help_text=self.fields['auto_checkin_sales_channels'].help_text,
|
||||
required=self.fields['auto_checkin_sales_channels'].required,
|
||||
choices=(
|
||||
(c.identifier, c.verbose_name) for c in get_all_sales_channels().values()
|
||||
),
|
||||
widget=forms.CheckboxSelectMultiple
|
||||
)
|
||||
|
||||
if self.event.has_subevents:
|
||||
self.fields['subevent'].queryset = self.event.subevents.all()
|
||||
self.fields['subevent'].widget = Select2(
|
||||
@@ -40,12 +51,14 @@ class CheckinListForm(forms.ModelForm):
|
||||
'all_products',
|
||||
'limit_products',
|
||||
'subevent',
|
||||
'include_pending'
|
||||
'include_pending',
|
||||
'auto_checkin_sales_channels'
|
||||
]
|
||||
widgets = {
|
||||
'limit_products': forms.CheckboxSelectMultiple(attrs={
|
||||
'data-inverse-dependency': '<[name$=all_products]'
|
||||
}),
|
||||
'auto_checkin_sales_channels': forms.CheckboxSelectMultiple()
|
||||
}
|
||||
field_classes = {
|
||||
'limit_products': SafeModelMultipleChoiceField,
|
||||
|
||||
Reference in New Issue
Block a user