def get_or_create_node(title, user):
    try:
        node = Node.find_one(
            Q('title', 'iexact', title)
            & Q('contributors', 'eq', user._id)
        )
        return node, False
    except ModularOdmException:
        node = new_node('project', title, user)
        return node, True
Call this callback when the session expires or logs out.
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/conferences/utils.py/get_or_create_node--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/guard.py/GuardSession.notifyOnExpire