Exemplo n.º 1
0
def queue_rereview(request):
    queues_helper = ReviewersQueuesHelper(request)
    qs = queues_helper.get_rereview_queue()
    apps = queues_helper.sort(qs)
    apps = [QueuedApp(app, app.rereviewqueue_set.all()[0].created)
            for app in apps]
    return _queue(request, apps, 'rereview')
Exemplo n.º 2
0
def queue_escalated(request):
    queues_helper = ReviewersQueuesHelper(request)
    qs = queues_helper.get_escalated_queue()
    apps = queues_helper.sort(qs)
    apps = [QueuedApp(app, app.escalationqueue_set.all()[0].created)
            for app in apps]
    return _queue(request, apps, 'escalated')
Exemplo n.º 3
0
def queue_apps(request):
    queues_helper = ReviewersQueuesHelper(request)
    qs = queues_helper.get_pending_queue()
    apps = queues_helper.sort(qs, date_sort='nomination')
    apps = [QueuedApp(app, app.all_versions[0].nomination)
            for app in Webapp.version_and_file_transformer(apps)]
    return _queue(request, apps, 'pending', date_sort='nomination')
Exemplo n.º 4
0
def queue_updates(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_updates_queue()
    apps = queues_helper.sort(apps, date_sort='nomination')

    if not use_es:
        apps = [QueuedApp(app, app.all_versions[0].nomination)
                for app in Webapp.version_and_file_transformer(apps)]

    return _queue(request, apps, 'updates', date_sort='nomination',
                  use_es=use_es)
Exemplo n.º 5
0
def queue_escalated(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_escalated_queue()
    apps = queues_helper.sort(apps, date_sort='created')

    if not use_es:
        apps = [QueuedApp(app, app.escalationqueue_set.all()[0].created)
                for app in apps]

    return _queue(request, apps, 'escalated', date_sort='created',
                  use_es=use_es)
Exemplo n.º 6
0
def queue_rereview(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_rereview_queue()
    apps = queues_helper.sort(apps, date_sort='created')

    if use_es:
        apps = [QueuedApp(app, app.rereview_date) for app in apps.execute()]
    else:
        apps = [QueuedApp(app, app.rereviewqueue_set.all()[0].created)
                for app in apps]

    return _queue(request, apps, 'rereview', date_sort='created',
                  use_es=use_es)
Exemplo n.º 7
0
def queue_escalated(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_escalated_queue()
    apps = queues_helper.sort(apps, date_sort='created')

    if use_es:
        apps = [QueuedApp(app, app.escalation_date) for app in apps.execute()]
    else:
        apps = [QueuedApp(app, app.escalationqueue_set.all()[0].created)
                for app in apps]

    return _queue(request, apps, 'escalated', date_sort='created',
                  use_es=use_es)
Exemplo n.º 8
0
def queue_updates(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_updates_queue()
    apps = queues_helper.sort(apps, date_sort='nomination')

    if use_es:
        apps = [QueuedApp(app, app.latest_version.nomination_date)
                for app in apps.execute()]
    else:
        apps = [QueuedApp(app, app.all_versions[0].nomination)
                for app in Webapp.version_and_file_transformer(apps)]

    return _queue(request, apps, 'updates', date_sort='nomination',
                  use_es=use_es)
Exemplo n.º 9
0
def queue_apps(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
    sort_field = 'nomination'

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    qs = queues_helper.get_pending_queue()
    qs = queues_helper.sort(qs, date_sort=sort_field)

    if use_es:
        apps = qs
    else:
        apps = [QueuedApp(app, app.all_versions[0].nomination)
                for app in Webapp.version_and_file_transformer(qs)]

    return _queue(request, apps, 'pending', date_sort='nomination',
                  use_es=use_es)
Exemplo n.º 10
0
def queue_homescreen(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
    sort_field = 'nomination'

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_homescreen_queue()
    apps = queues_helper.sort(apps, date_sort=sort_field)

    if use_es:
        apps = [QueuedApp(app, app.latest_version.nomination_date)
                for app in apps.execute()]
    else:
        apps = [QueuedApp(app, app.all_versions[0].nomination)
                for app in Webapp.version_and_file_transformer(apps)]

    return _queue(request, apps, 'homescreen', date_sort='nomination',
                  use_es=use_es)
Exemplo n.º 11
0
def queue_rereview(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_rereview_queue()
    apps = queues_helper.sort(apps, date_sort='created')

    if not use_es:
        apps = [
            QueuedApp(app,
                      app.rereviewqueue_set.all()[0].created) for app in apps
        ]

    return _queue(request,
                  apps,
                  'rereview',
                  date_sort='created',
                  use_es=use_es)
Exemplo n.º 12
0
def queue_region(request, region=None):
    # TODO: Create a landing page that lists all the special regions.
    if region is None:
        raise http.Http404

    region = parse_region(region)
    column = '_geodata__region_%s_nominated' % region.slug

    queues_helper = ReviewersQueuesHelper(request)
    qs = Webapp.objects.pending_in_region(region)
    apps = [ActionableQueuedApp(app, app.geodata.get_nominated_date(region),
                                reverse('approve-region',
                                        args=[app.id, region.slug]))
            for app in queues_helper.sort(qs, date_sort=column)]

    return _queue(request, apps, 'region', date_sort=column,
                  template='reviewers/queue_region.html',
                  data={'region': region})
Exemplo n.º 13
0
def queue_region(request, region=None):
    # TODO: Create a landing page that lists all the special regions.
    if region is None:
        raise http.Http404

    region = parse_region(region)
    column = '_geodata__region_%s_nominated' % region.slug

    queues_helper = ReviewersQueuesHelper(request)
    qs = Webapp.objects.pending_in_region(region)
    apps = [ActionableQueuedApp(app, app.geodata.get_nominated_date(region),
                                reverse('approve-region',
                                        args=[app.id, region.slug]))
            for app in queues_helper.sort(qs, date_sort=column)]

    return _queue(request, apps, 'region', date_sort=column,
                  template='reviewers/queue_region.html',
                  data={'region': region})
Exemplo n.º 14
0
def queue_apps(request):
    use_es = waffle.switch_is_active('reviewer-tools-elasticsearch')
    sort_field = 'nomination'

    queues_helper = ReviewersQueuesHelper(request, use_es=use_es)
    apps = queues_helper.get_pending_queue()
    apps = queues_helper.sort(apps, date_sort=sort_field)

    if not use_es:
        apps = [
            QueuedApp(app, app.all_versions[0].nomination)
            for app in Webapp.version_and_file_transformer(apps)
        ]

    return _queue(request,
                  apps,
                  'pending',
                  date_sort='nomination',
                  use_es=use_es)