Fix performance and logic issues in auto-exit-all

This commit is contained in:
Raphael Michel
2023-01-25 09:50:36 +01:00
parent f81b7bcf53
commit 9eb2d43016
2 changed files with 66 additions and 58 deletions

View File

@@ -842,10 +842,7 @@ def process_exit_all(sender, **kwargs):
exit_all_at__isnull=False
).select_related('event', 'event__organizer')
for cl in qs:
positions = cl.positions_inside.filter(
Q(last_exit__isnull=True) | Q(last_exit__lte=cl.exit_all_at),
last_entry__lte=cl.exit_all_at,
)
positions = cl.positions_inside_query(ignore_status=True, at_time=cl.exit_all_at)
for p in positions:
with scope(organizer=cl.event.organizer):
ci = Checkin.objects.create(