mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Check-in history: Allow to filter for error reasons
This commit is contained in:
@@ -1788,11 +1788,11 @@ class OverviewFilterForm(FilterForm):
|
|||||||
class CheckinFilterForm(FilterForm):
|
class CheckinFilterForm(FilterForm):
|
||||||
status = forms.ChoiceField(
|
status = forms.ChoiceField(
|
||||||
label=_('Status'),
|
label=_('Status'),
|
||||||
choices=(
|
choices=[
|
||||||
('', _('All check-ins')),
|
('', _('All check-ins')),
|
||||||
('successful', _('Successful check-ins')),
|
('successful', _('Successful check-ins')),
|
||||||
('unsuccessful', _('Unsuccessful check-ins')),
|
('unsuccessful', _('Unsuccessful check-ins')),
|
||||||
),
|
] + list(Checkin.REASONS),
|
||||||
required=False
|
required=False
|
||||||
)
|
)
|
||||||
type = forms.ChoiceField(
|
type = forms.ChoiceField(
|
||||||
@@ -1873,6 +1873,8 @@ class CheckinFilterForm(FilterForm):
|
|||||||
qs = qs.filter(successful=True)
|
qs = qs.filter(successful=True)
|
||||||
elif s == 'unsuccessful':
|
elif s == 'unsuccessful':
|
||||||
qs = qs.filter(successful=False)
|
qs = qs.filter(successful=False)
|
||||||
|
elif s:
|
||||||
|
qs = qs.filter(successful=False, error_reason=s)
|
||||||
|
|
||||||
if fdata.get('type'):
|
if fdata.get('type'):
|
||||||
qs = qs.filter(type=fdata.get('type'))
|
qs = qs.filter(type=fdata.get('type'))
|
||||||
|
|||||||
Reference in New Issue
Block a user