Point values not mapping to the correct levels

RESOLVED FIXED in 2013-06-13

Status

addons.mozilla.org Graveyard
Admin/Editor Tools
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: amyt, Assigned: kmag)

Tracking

unspecified
2013-06-13
x86
Mac OS X

Details

Attachments

(2 attachments)

(Reporter)

Description

5 years ago
Created attachment 725602 [details]
Archaeopteryx

We are not currently displaying the correct levels on the reviewer leaderboard. Giorgio should be on Level 2 (not Level 3) with 6,007 points, and Archaeopteryx should not have any level assigned since he has 1,250 points.

The table is here: https://wiki.mozilla.org/Marketplace/Reviewers/Points_and_Incentives
(Reporter)

Comment 1

5 years ago
Created attachment 725604 [details]
Giorgio
Untested:

diff --git a/apps/editors/models.py b/apps/editors/models.py
index df63776..563715e 100644
--- a/apps/editors/models.py
+++ b/apps/editors/models.py
@@ -648,11 +648,14 @@ class ReviewerScore(amo.models.ModelBase):
             user_level = len(amo.REVIEWED_LEVELS) - 1
             for i, level in enumerate(amo.REVIEWED_LEVELS):
                 if total < level['points']:
-                    user_level = i
+                    user_level = i - 1
                     break
 
             # Only show level if it changes.
-            level = amo.REVIEWED_LEVELS[user_level]['name']
+            if user_level < 0:
+                level = ''
+            else:
+                level = amo.REVIEWED_LEVELS[user_level]['name']
             if prev == level:
                 level = ''
             else:
Assignee: nobody → kmaglione+bmo
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2013-06-13
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.