本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)