@classmethod
    def award_points(cls, user, addon, status, **kwargs):
        """Awards points to user based on an event and the queue.

        `event` is one of the `REVIEWED_` keys in constants.
        `status` is one of the `STATUS_` keys in constants.

        """
        event = cls.get_event(addon, status, **kwargs)
        score = amo.REVIEWED_SCORES.get(event)

        try:
            # Add bonus to reviews greater than our limit to encourage fixing
            # old reviews.
            vq = ViewQueue.objects.get(
                addon_slug=addon.slug,
            )

            if vq.waiting_time_days > amo.REVIEWED_OVERDUE_LIMIT:
                days_over = vq.waiting_time_days - amo.REVIEWED_OVERDUE_LIMIT
                bonus = days_over * amo.REVIEWED_OVERDUE_BONUS
                score = score + bonus
        except ViewQueue.DoesNotExist:
            # If the object does not exist then we simply do not add a bonus
            pass

        if score:
            cls.objects.create(user=user, addon=addon, score=score,
                               note_key=event)
            cls.get_key(invalidate=True)
            user_log.info(
                (u'Awarding %s points to user %s for "%s" for addon %s' % (
                    score, user, amo.REVIEWED_CHOICES[event], addon.id))
                .encode('utf-8'))
        return score
dataset/ETHPy150Open mozilla/addons-server/src/olympia/editors/models.py/ReviewerScore.award_points/original