2
0
Fork 0

more equality

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

View File

@ -84,9 +84,10 @@ class TeamMember(models.Model):
distinct=True, distinct=True,
filter=Q(fallback_shifts__id__in=canidate_shift_ids), filter=Q(fallback_shifts__id__in=canidate_shift_ids),
), ),
overall_fallback_count=Count("fallback_shifts"),
) )
.exclude(pk=self.pk) .exclude(pk=self.pk)
.order_by("-relevant_fallback_count", "?") .order_by("-relevant_fallback_count", "-overall_fallback_count", "?")
) )
assignment = False assignment = False
for member in sorted_members: for member in sorted_members: