Fix #406 -- Allow moving waiting list entries to the top or bottom

This commit is contained in:
Raphael Michel
2018-08-07 10:53:07 +02:00
parent 0100604798
commit 67897dfcc0
7 changed files with 124 additions and 23 deletions

View File

@@ -22,7 +22,9 @@ def assign_automatically(event_id: int, user_id: int=None, subevent_id: int=None
qs = WaitingListEntry.objects.filter(
event=event, voucher__isnull=True
).select_related('item', 'variation').prefetch_related('item__quotas', 'variation__quotas').order_by('created')
).select_related('item', 'variation').prefetch_related(
'item__quotas', 'variation__quotas'
).order_by('-priority', 'created')
if subevent_id and event.has_subevents:
subevent = event.subevents.get(id=subevent_id)