def update_to_valid_shipping_method(request, customer, save=False):
    valid_sms = get_valid_shipping_methods(request)

    if customer.selected_shipping_method not in valid_sms:
        customer.selected_shipping_method = get_default_shipping_method(request)
        if save:
            customer.save()
After this has been called the given customer has a valid shipping
dataset/ETHPy150Open diefenbach/django-lfs/lfs/shipping/utils.py/update_to_valid_shipping_method