2
0
Fork 0

fix team free shift sorting

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-18 15:01:57 +02:00
parent f5d2b7ee7c
commit 4900a90dc0
1 changed files with 7 additions and 3 deletions

View File

@ -139,7 +139,11 @@ class FreeShiftList(ShiftList):
help_wanted = Q(required_helpers__gt=F("reg_count")) | Q(
required_helpers=0
) & Q(room__required_helpers__gt=F("reg_count"))
return Shift.with_reg_count().filter(
help_wanted,
start_at__gt=timezone.now(),
return (
Shift.with_reg_count()
.filter(
help_wanted,
start_at__gt=timezone.now(),
)
.order_by("start_at", "room_id")
)