Fixed top reviewers leaderboard not showing oneself (bug 808508)

This commit is contained in:
Andreas Wagner 2012-11-06 01:05:30 +01:00
Родитель 106e513b50
Коммит ba0c10cf55
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -563,13 +563,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.