Skip to content
Snippets Groups Projects
Verified Commit 588d8c15 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix calculation of ranks for categories with multiple persons

parent f0c97b0d
No related branches found
No related tags found
No related merge requests found
......@@ -233,8 +233,10 @@ class RankingCategory(ExtensibleModel):
return "ranking_" + slugify(self.name).replace("-", "_") + "_" + str(self.group.pk)
def calculate_ranks(self):
qs = Ranking.objects.filter(category=self, persons__isnull=False).prefetch_related(
"persons"
qs = (
Ranking.objects.filter(category=self, persons__isnull=False)
.distinct()
.prefetch_related("persons")
)
persons = {}
ranks = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment