@permission_required("core.manage_shop")
def manage_shipping(request):
    """Dispatches to the first shipping method or to the add shipping method
    form if there is no shipping method.
    """
    try:
        shipping_method = ShippingMethod.objects.all()[0]
    except __HOLE__:
        url = reverse("lfs_manage_no_shipping_methods")
    else:
        url = reverse("lfs_manage_shipping_method",
            kwargs={"shipping_method_id": shipping_method.id})
    return HttpResponseRedirect(url)
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/shipping_methods/views.py/manage_shipping