Ensure we don't approve when groups are lower than the requested number

This commit is contained in:
Marc Di Luzio 2024-08-10 16:30:33 +01:00
parent e002c5c9d5
commit 1bef611806

View file

@ -120,7 +120,8 @@ def members_to_groups(matchees: list[Member],
groups = attempt_create_groups( groups = attempt_create_groups(
matchees, hist, oldest_relevant_datetime, num_groups) matchees, hist, oldest_relevant_datetime, num_groups)
if groups: # Fail the match if our groups aren't big enough
if groups and all(len(g) > per_group for g in groups):
logger.info("Matched groups after %s attempt(s)", attempts) logger.info("Matched groups after %s attempt(s)", attempts)
return groups return groups