@permission_required("core.manage_shop")
def manage_delivery_times(request):
    """Dispatches to the first delivery time or to the form to add a delivery
    time (if there is no delivery time yet).
    """
    try:
        delivery_time = DeliveryTime.objects.all()[0]
        url = reverse("lfs_manage_delivery_time", kwargs={"id": delivery_time.id})
    except __HOLE__:
        url = reverse("lfs_no_delivery_times")

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