@permission_required("core.manage_shop")
@require_POST
def delete_shipping_method(request, shipping_method_id):
    try:
        shipping_method = ShippingMethod.objects.get(pk=shipping_method_id)
    except ObjectDoesNotExist:
        pass
    else:
        for customer in Customer.objects.filter(selected_shipping_method=shipping_method_id):
            customer.selected_shipping_method = shipping_utils.get_default_shipping_method(request)
            customer.save()

        shipping_method.delete()

    return lfs.core.utils.set_message_cookie(
        url=reverse("lfs_manage_shipping"),
        msg=_(u"Shipping method has been deleted."),
    )
Deletes shipping method with passed shipping id.
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/shipping_methods/views.py/delete_shipping_method