Absent/Checked Out persons in Checkin lists (#1721)

This commit is contained in:
Martin Gross
2020-07-20 10:41:39 +02:00
committed by GitHub
parent 3c5948d2e0
commit 6842127802
2 changed files with 26 additions and 2 deletions

View File

@@ -837,6 +837,7 @@ class CheckInFilterForm(FilterForm):
label=_('Check-in status'),
choices=(
('', _('All attendees')),
('3', pgettext_lazy('checkin state', 'Checked in but left')),
('2', pgettext_lazy('checkin state', 'Present')),
('1', _('Checked in')),
('0', _('Not checked in')),
@@ -883,6 +884,10 @@ class CheckInFilterForm(FilterForm):
qs = qs.filter(last_entry__isnull=False).filter(
Q(last_exit__isnull=True) | Q(last_exit__lt=F('last_entry'))
)
elif s == '3':
qs = qs.filter(last_entry__isnull=False).filter(
Q(last_exit__isnull=False) & Q(last_exit__gte=F('last_entry'))
)
elif s == '0':
qs = qs.filter(last_entry__isnull=True)