def METHOD_NAME(user):
    if not user_can_be_archived(user):
        msg = "User cannot be removed from service. " "Check that all services have another team member who can manage settings"
        raise InvalidRequest(msg, 400)
    permission_dao.remove_user_service_permissions_for_all_services(user)
    service_users = dao_get_service_users_by_user_id(user.id)
    for service_user in service_users:
        db.session.delete(service_user)
    user.organisations = []
    user.auth_type = EMAIL_AUTH_TYPE
    user.email_address = get_archived_email_address(user.email_address)
    user.mobile_number = None
    user.password = str(uuid.uuid4())
    # Changing the current_session_id signs the user out
    user.current_session_id = "00000000-0000-0000-0000-000000000000"
    user.state = "inactive"
    db.session.add(user)