Skip to content

Commit

Permalink
fix: bug with group maximum counting
Browse files Browse the repository at this point in the history
- the value defaults to 0
- this meant everything was viewed as over
  • Loading branch information
brownben committed Apr 1, 2024
1 parent 67f2f42 commit 160cbe4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/utils/counting_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ def find_counting_results(
# Add the top results up to the minimum counting
counting_results.update(sorted_results_in_group[:group_min])
remaining_results.difference_update(counting_results)

# Remove the bottom results which included would take the number over the maximum
remaining_results.difference_update(sorted_results_in_group[group_max:])
if group_max and group_max > 0:
remaining_results.difference_update(sorted_results_in_group[group_max:])

# Then add the largest results left until the max number is reached
number_of_results_left = max_number_of_counting_results - len(counting_results)
Expand Down

0 comments on commit 160cbe4

Please sign in to comment.