diff --git a/src/pretix/plugins/checkinlists/exporters.py b/src/pretix/plugins/checkinlists/exporters.py index 115f1e0fd4..6ff2c0161b 100644 --- a/src/pretix/plugins/checkinlists/exporters.py +++ b/src/pretix/plugins/checkinlists/exporters.py @@ -3,7 +3,9 @@ from collections import OrderedDict import dateutil.parser from django import forms from django.conf import settings -from django.db.models import Case, Exists, Max, OuterRef, Subquery, Value, When +from django.db.models import ( + Case, Exists, Max, OuterRef, Q, Subquery, Value, When, +) from django.db.models.functions import Coalesce, NullIf from django.urls import reverse from django.utils.formats import date_format @@ -44,6 +46,11 @@ class CheckInListMixin(BaseExporter): label=_('Include QR-code secret'), required=False )), + ('attention_only', + forms.BooleanField( + label=_('Only tickets requiring special attention'), + required=False + )), ('sort', forms.ChoiceField( label=_('Sort by'), @@ -136,6 +143,9 @@ class CheckInListMixin(BaseExporter): 'resolved_name_part' ) + if form_data['attention_only']: + qs = qs.filter(Q(item__checkin_attention=True) | Q(order__checkin_attention=True)) + if not cl.include_pending: qs = qs.filter(order__status=Order.STATUS_PAID) else: