Merge pull request #492 from wagnerand/ba0c10cf55709cb05ecd2193a93ca9679d912e49
Fix for Top Reviewers leaderboard is missing own entry (bug 808508)
This commit is contained in:
Коммит
314fa03906
|
@ -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.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче