2
0
Fork 0

dont overwrite other bucket shifts during assignment

This commit is contained in:
Andreas (@xAndy) Zimmermann 2023-05-13 15:10:17 +02:00
parent d1e06d00ec
commit 534b504460
1 changed files with 3 additions and 1 deletions

View File

@ -51,7 +51,9 @@ class TeamMember(models.Model):
)
# easy part: enough free shifts for everyone:
shifts = free_bucket.order_by("?")[:shift_count]
self.fallback_shifts.set(shifts)
for shift in shifts:
self.fallback_shifts.add(shift)
# there is a chance that even if qota*teammembers team members are activatet, there are still unasigned shifts
# this happens if there are shifts with multiple people left, as we can not assign multiple slots for
# the same shift to one member.