diff options
| author | Karan Jayachandra <mail@karanjayachandra.com> | 2024-12-02 19:54:11 +0100 |
|---|---|---|
| committer | Karan Jayachandra <mail@karanjayachandra.com> | 2024-12-02 19:54:11 +0100 |
| commit | ed182035cdd39659563b25ffef5387578db25799 (patch) | |
| tree | 00b298d5674c75d076a6356b4b95b1673b3cbd7b /src/match_up/controller.py | |
| parent | b9967b20dddaed6673d2333edc7cdee735ed1395 (diff) | |
Fixed issue of the database not loading the teams
Diffstat (limited to 'src/match_up/controller.py')
| -rw-r--r-- | src/match_up/controller.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/match_up/controller.py b/src/match_up/controller.py index a02dd04..4c7119f 100644 --- a/src/match_up/controller.py +++ b/src/match_up/controller.py @@ -45,11 +45,14 @@ class RoundGenerator: active_teams = {} players_without_team = [] for team_id in grouped_players_by_team: - if team_id == 0 or len(grouped_players_by_team[team_id]) < 4: + if team_id == 0: players_without_team += [player for player in grouped_players_by_team[team_id]] else: - active_teams[team_id] = grouped_players_by_team[team_id] - + if len(grouped_players_by_team[team_id]) >= 4: + active_teams[team_id] = grouped_players_by_team[team_id] + else: + players_without_team += [player for player in grouped_players_by_team[team_id]] + regular_courts = len(used_courts) - len(active_teams) reg_courts = {A:N for (A,N) in [x for x in used_courts.items()][:regular_courts]} team_courts = {A:N for (A,N) in [x for x in used_courts.items()][regular_courts:]} |
