当前位置: 首页>>代码示例>>Python>>正文


Python ReviewerScore.award_points方法代码示例

本文整理汇总了Python中mkt.reviewers.models.ReviewerScore.award_points方法的典型用法代码示例。如果您正苦于以下问题:Python ReviewerScore.award_points方法的具体用法?Python ReviewerScore.award_points怎么用?Python ReviewerScore.award_points使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mkt.reviewers.models.ReviewerScore的用法示例。


在下文中一共展示了ReviewerScore.award_points方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_reject

# 需要导入模块: from mkt.reviewers.models import ReviewerScore [as 别名]
# 或者: from mkt.reviewers.models.ReviewerScore import award_points [as 别名]
    def process_reject(self):
        """
        Reject an app.
        Changes status to Rejected.
        Creates Rejection note.
        """
        # Hold onto the status before we change it.
        status = self.addon.status

        self.set_files(mkt.STATUS_DISABLED, self.version.files.all(),
                       hide_disabled_file=True)
        # If this app is not packaged (packaged apps can have multiple
        # versions) or if there aren't other versions with already reviewed
        # files, reject the app also.
        if (not self.addon.is_packaged or
            not self.addon.versions.exclude(id=self.version.id)
                .filter(files__status__in=mkt.REVIEWED_STATUSES).exists()):
            self.set_addon(status=mkt.STATUS_REJECTED)

        if self.in_escalate:
            EscalationQueue.objects.filter(addon=self.addon).delete()
        if self.in_rereview:
            RereviewQueue.objects.filter(addon=self.addon).delete()

        self.create_note(mkt.LOG.REJECT_VERSION)

        log.info(u'Making %s disabled' % self.addon)

        # Assign reviewer incentive scores.
        return ReviewerScore.award_points(self.request.user, self.addon,
                                          status, in_rereview=self.in_rereview)
开发者ID:Jobava,项目名称:zamboni,代码行数:33,代码来源:utils.py

示例2: process_public

# 需要导入模块: from mkt.reviewers.models import ReviewerScore [as 别名]
# 或者: from mkt.reviewers.models.ReviewerScore import award_points [as 别名]
    def process_public(self):
        """
        Makes an app public or approved.
        Changes status to Public/Public Waiting.
        Creates Approval note/email.
        """
        if self.addon.has_incomplete_status():
            # Failsafe.
            return

        # Hold onto the status before we change it.
        status = self.addon.status
        if self.addon.make_public == amo.PUBLIC_IMMEDIATELY:
            self._process_public_immediately()
        else:
            self._process_approved()

        if self.in_escalate:
            EscalationQueue.objects.filter(addon=self.addon).delete()

        # Clear priority_review flag on approval - its not persistant.
        if self.addon.priority_review:
            self.addon.update(priority_review=False)

        # Assign reviewer incentive scores.
        return ReviewerScore.award_points(self.request.amo_user, self.addon,
                                          status)
开发者ID:petercpg,项目名称:zamboni,代码行数:29,代码来源:utils.py

示例3: process_clear_rereview

# 需要导入模块: from mkt.reviewers.models import ReviewerScore [as 别名]
# 或者: from mkt.reviewers.models.ReviewerScore import award_points [as 别名]
 def process_clear_rereview(self):
     """
     Clear app from re-review queue.
     Doesn't change status.
     Creates Reviewer-only note.
     """
     RereviewQueue.objects.filter(addon=self.addon).delete()
     self.create_note(mkt.LOG.REREVIEW_CLEARED)
     log.info(u"Re-review cleared for app: %s" % self.addon)
     # Assign reviewer incentive scores.
     return ReviewerScore.award_points(self.request.user, self.addon, self.addon.status, in_rereview=True)
开发者ID:TwinkleChawla,项目名称:zamboni,代码行数:13,代码来源:utils.py

示例4: process_approve

# 需要导入模块: from mkt.reviewers.models import ReviewerScore [as 别名]
# 或者: from mkt.reviewers.models.ReviewerScore import award_points [as 别名]
    def process_approve(self):
        """
        Handle the approval of apps and/or files.
        """
        if self.addon.has_incomplete_status():
            # Failsafe.
            return

        # Hold onto the status before we change it.
        status = self.addon.status
        if self.addon.publish_type == mkt.PUBLISH_IMMEDIATE:
            self._process_public(mkt.STATUS_PUBLIC)
        elif self.addon.publish_type == mkt.PUBLISH_HIDDEN:
            self._process_public(mkt.STATUS_UNLISTED)
        else:
            self._process_private()

        # Note: Post save signals shouldn't happen here. All the set_*()
        # methods pass _signal=False to prevent them from being sent. They are
        # manually triggered in the view after the transaction is committed to
        # avoid multiple indexing tasks getting fired with stale data.
        #
        # This does mean that we need to call update_version() manually to get
        # the addon in the correct state before updating names. We do that,
        # passing _signal=False again to prevent it from sending
        # 'version_changed'. The post_save() that happen in the view will
        # call it without that parameter, sending 'version_changed' normally.
        self.addon.update_version(_signal=False)
        if self.addon.is_packaged:
            self.addon.update_name_from_package_manifest()
        self.addon.update_supported_locales()
        self.addon.resend_version_changed_signal = True

        if self.in_escalate:
            EscalationQueue.objects.filter(addon=self.addon).delete()

        # Clear priority_review flag on approval - its not persistant.
        if self.addon.priority_review:
            self.addon.update(priority_review=False)

        # Assign reviewer incentive scores.
        return ReviewerScore.award_points(self.request.user, self.addon,
                                          status)
开发者ID:Jobava,项目名称:zamboni,代码行数:45,代码来源:utils.py

示例5: _give_points

# 需要导入模块: from mkt.reviewers.models import ReviewerScore [as 别名]
# 或者: from mkt.reviewers.models.ReviewerScore import award_points [as 别名]
 def _give_points(self, user=None, app=None, status=None):
     user = user or self.user
     app = app or self.app
     ReviewerScore.award_points(user, app, status or app.status)
开发者ID:anushbmx,项目名称:zamboni,代码行数:6,代码来源:test_models.py


注:本文中的mkt.reviewers.models.ReviewerScore.award_points方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。