@permission_required("core.manage_shop")
def manage_vouchers(request):
    """Redirects to the first voucher group or to no voucher groups view.
    """
    try:
        voucher_group = VoucherGroup.objects.all()[0]
    except __HOLE__:
        url = reverse("lfs_no_vouchers")
    else:
        url = reverse("lfs_manage_voucher_group", kwargs={"id": voucher_group.id})

    return HttpResponseRedirect(url)
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/voucher/views.py/manage_vouchers