@permission_required("core.manage_shop")
def manage_vouchers(request):
    try:
        voucher_group = VoucherGroup.objects.all()[0]
    except IndexError:
        url = reverse("lfs_no_vouchers")
    else:
        url = reverse("lfs_manage_voucher_group", kwargs={"id": voucher_group.id})

    return HttpResponseRedirect(url)
Redirects to the first voucher group or to no voucher groups view.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/voucher/views.py/manage_vouchers