Check-in: New flags for check-in lists (#3577)

This commit is contained in:
Raphael Michel
2023-10-23 15:52:06 +02:00
committed by GitHub
parent da9aa3e133
commit a0831890ad
14 changed files with 82 additions and 13 deletions

View File

@@ -2072,7 +2072,8 @@ class VoucherFilterForm(FilterForm):
qs = qs.filter(Q(valid_until__isnull=False) & Q(valid_until__lt=now())).filter(redeemed=0)
elif s == 'c':
checkins = Checkin.objects.filter(
position__voucher=OuterRef('pk')
position__voucher=OuterRef('pk'),
list__consider_tickets_used=True,
)
qs = qs.annotate(has_checkin=Exists(checkins)).filter(
redeemed__gt=0, has_checkin=True