diff --git a/shiftregister/fallback/models.py b/shiftregister/fallback/models.py index 9c90613..2132bf9 100644 --- a/shiftregister/fallback/models.py +++ b/shiftregister/fallback/models.py @@ -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.