def METHOD_NAME(request, thread, new_owner):
    ThreadParticipant.objects.set_owner(thread, new_owner)
    set_users_unread_private_threads_sync(
        participants=thread.participants_list, exclude_user=request.user
    )
    if thread.participant and thread.participant.is_owner:
        record_event(
            request,
            thread,
            "changed_owner",
            {
                "user": {
                    "id": new_owner.id,
                    "username": new_owner.username,
                    "url": new_owner.get_absolute_url(),
                }
            },
        )
    else:
        record_event(request, thread, "tookover")