()
return 'Orphans cleaned.'
Murders all orphans.
Murders all orphans.
Murders all orphans .
def admin_orphans():
    """
    Murders all orphans.
    """
    # Clean up orphaned channels.
    db.session.query(Channel).\
        filter(~Channel.project.has()).\
        delete(synchronize_session=False)

    # Clean up orphaned hooks.
    db.session.query(Hook).\
        filter(~Hook.project.has()).\
        delete(synchronize_session=False)

    db.session.commit()

    return 'Orphans cleaned.'
def admin_orphans ( ) : # Clean up orphaned channels. db . session . query ( Channel ) . filter ( ~ Channel . project . has ( ) ) . delete ( synchronize_session = False ) # Clean up orphaned hooks. db . session . query ( Hook ) . filter ( ~ Hook . project . has ( ) ) . delete ( synchronize_session = False ) db . session . commit ( ) return 'Orphans cleaned.'