From 1bef611806ec814de583389bd3ca7d6c4477aa61 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sat, 10 Aug 2024 16:30:33 +0100 Subject: [PATCH] Ensure we don't approve when groups are lower than the requested number --- matching.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matching.py b/matching.py index 5ba7295..cc7651a 100644 --- a/matching.py +++ b/matching.py @@ -120,7 +120,8 @@ def members_to_groups(matchees: list[Member], groups = attempt_create_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) return groups