Merge pull request #492 from wagnerand/ba0c10cf55709cb05ecd2193a93ca9679d912e49

Fix for Top Reviewers leaderboard is missing own entry (bug 808508)
This commit is contained in:
Matt Basta 2012-11-05 16:16:39 -08:00
Родитель b0596842b3 ba0c10cf55
Коммит 314fa03906
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -576,13 +576,13 @@ class ReviewerScore(amo.models.ModelBase):
if not in_leaderboard:
leader_top = scores[:5]
else:
if rank <= 5: # User is in top 5, show top 5.
if user_rank <= 5: # User is in top 5, show top 5.
leader_top = scores[:5]
else:
leader_top = scores[:3]
leader_near = [scores[rank - 2], scores[rank - 1]]
leader_near = [scores[user_rank - 2], scores[user_rank - 1]]
try:
leader_near.append(scores[rank])
leader_near.append(scores[user_rank])
except IndexError:
pass # User is last on the leaderboard.