def _check_new_checkout_address(checkout, address):
    """Check if and address in checkout has changed and if to remove old one."""
    old_address = checkout.shipping_address

    has_address_changed = any(
        [
            not address and old_address,
            address and not old_address,
            address and old_address and address != old_address,
        ]
    )

    remove_old_address = (
            has_address_changed
            and old_address is not None
            and (not checkout.user or old_address not in checkout.user.addresses.all())
    )

    return has_address_changed, remove_old_address