def queue_moderated(request): rf = (Review.objects.exclude(Q(addon__isnull=True) | Q(reviewflag__isnull=True)) .filter(editorreview=1) .order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if request.method == 'POST': if reviews_formset.is_valid(): reviews_formset.save() else: amo.messages.error( request, ' '.join(e.as_text() or _('An unknown error occurred') for e in reviews_formset.errors)) return redirect(reverse('editors.queue_moderated')) return render(request, 'editors/queue.html', context(reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, search_form=None, point_types=amo.REVIEWED_AMO))
def queue_moderated(request): # In addition to other checks, this only show reviews for public and # listed add-ons. Unlisted add-ons typically won't have reviews anyway # but they might if their status ever gets changed. rf = (Review.objects.exclude(Q(addon__isnull=True) | Q(addon__is_listed=False) | Q(reviewflag__isnull=True)) .filter(editorreview=1, addon__status__in=amo.LISTED_STATUSES) .order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) motd_editable = acl.action_allowed(request, 'AddonReviewerMOTD', 'Edit') flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if request.method == 'POST': if reviews_formset.is_valid(): reviews_formset.save() else: amo.messages.error( request, ' '.join(e.as_text() or _('An unknown error occurred') for e in reviews_formset.errors)) return redirect(reverse('editors.queue_moderated')) return render(request, 'editors/queue.html', context(request, reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, search_form=None, point_types=amo.REVIEWED_AMO, motd_editable=motd_editable))
def queue_moderated(request): rf = (Review.objects.exclude( Q(addon__isnull=True) | Q(reviewflag__isnull=True)).filter( editorreview=1).order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if request.method == 'POST': if reviews_formset.is_valid(): reviews_formset.save() else: amo.messages.error( request, ' '.join(e.as_text() or _('An unknown error occurred') for e in reviews_formset.errors)) return redirect(reverse('editors.queue_moderated')) return render( request, 'editors/queue.html', context(reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, search_form=None, point_types=amo.REVIEWED_AMO))
def queue_moderated(request): rf = (Review.objects.filter(editorreview=1, reviewflag__isnull=False, addon__isnull=False) .order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list) if reviews_formset.is_valid(): reviews_formset.save() return redirect(reverse('editors.queue_moderated')) return jingo.render(request, 'editors/queue.html', context(reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, search_form=None))
def queue_moderated(request): """Queue for reviewing app reviews.""" rf = (Review.objects.no_cache() .exclude(Q(addon__isnull=True) | Q(reviewflag__isnull=True)) .filter(addon__type=amo.ADDON_WEBAPP, editorreview=True) .order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if reviews_formset.is_valid(): reviews_formset.save() return redirect(reverse('reviewers.apps.queue_moderated')) return render(request, 'reviewers/queue.html', context(request, reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags))
def queue_moderated(request): """Queue for reviewing app reviews.""" rf = (Review.objects.no_cache() .exclude(Q(addon__isnull=True) | Q(reviewflag__isnull=True)) .filter(addon__type=amo.ADDON_WEBAPP, editorreview=True) .order_by('reviewflag__created')) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if reviews_formset.is_valid(): reviews_formset.save() return redirect(reverse('reviewers.apps.queue_moderated')) return jingo.render(request, 'reviewers/queue.html', context(request, reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags))
def queue_moderated(request): rf = ( Review.objects.exclude(Q(addon__type=amo.ADDON_WEBAPP) | Q(addon__isnull=True) | Q(reviewflag__isnull=True)) .filter(editorreview=1) .order_by("reviewflag__created") ) page = paginate(request, rf, per_page=20) flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list) if reviews_formset.is_valid(): reviews_formset.save() return redirect(reverse("editors.queue_moderated")) return jingo.render( request, "editors/queue.html", context(reviews_formset=reviews_formset, tab="moderated", page=page, flags=flags, search_form=None), )
def queue_moderated(request): # In addition to other checks, this only show reviews for public and # listed add-ons. Unlisted add-ons typically won't have reviews anyway # but they might if their status ever gets changed. rf = (Review.objects.exclude( Q(addon__isnull=True) | Q(addon__is_listed=False) | Q(reviewflag__isnull=True)).filter( editorreview=1, addon__status__in=amo.LISTED_STATUSES).order_by( 'reviewflag__created')) page = paginate(request, rf, per_page=20) motd_editable = acl.action_allowed(request, 'AddonReviewerMOTD', 'Edit') flags = dict(ReviewFlag.FLAGS) reviews_formset = ReviewFlagFormSet(request.POST or None, queryset=page.object_list, request=request) if request.method == 'POST': if reviews_formset.is_valid(): reviews_formset.save() else: amo.messages.error( request, ' '.join(e.as_text() or _('An unknown error occurred') for e in reviews_formset.errors)) return redirect(reverse('editors.queue_moderated')) return render( request, 'editors/queue.html', context(request, reviews_formset=reviews_formset, tab='moderated', page=page, flags=flags, search_form=None, point_types=amo.REVIEWED_AMO, motd_editable=motd_editable))