Skip to content

Commit

Permalink
Fix crash in trainee allocations when there are not solo chaired debates
Browse files Browse the repository at this point in the history
The logger.info will throw if cost_matrix is an empty array; I figure may as well just skip the whole process at that stage though.
  • Loading branch information
philipbelesky committed Jul 22, 2017
1 parent ac35e63 commit d73e5a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tabbycat/adjallocation/hungarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ def allocate(self):
logger.info("allocating to %s: %s (c), %s", aa.debate, aa.chair, ", ".join([str(p) for p in aa.panellists]))

# Allocate trainees, one per solo debate (leave the rest unallocated)

if len(trainees) > 0:
if len(trainees) > 0 and len(solo_debates) > 0:
allocation_by_debate = {aa.debate: aa for aa in alloc}

logger.info("costing trainees")
Expand Down

0 comments on commit d73e5a0

Please sign in to comment.