Skip to content

Commit 1d6169b

Browse files
authored
Merge pull request #2066 from codalab/fix-bestmodestrategy
Fix BestModeStrategy to exclude soft-deleted and non-finished submissions
2 parents c538c75 + fe3e5a2 commit 1d6169b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/apps/leaderboards/strategies.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def _choose_best_submission(self, leaderboard, owner, phase):
8484
primary_col = leaderboard.columns.get(index=leaderboard.primary_index)
8585
ordering = [f'{"-" if primary_col.sorting == "desc" else ""}primary_col']
8686

87-
submissions = Submission.objects.filter(phase=phase, owner=owner) \
87+
submissions = Submission.objects.filter(phase=phase,
88+
owner=owner,
89+
is_soft_deleted=False,
90+
status=Submission.FINISHED) \
8891
.select_related('owner').prefetch_related('scores') \
8992
.annotate(primary_col=Sum('scores__score', filter=Q(scores__column=primary_col)))
9093

0 commit comments

Comments
 (0)