Example #1
0
def api_client(manager):
    with Session() as session:
        user = session.query(User).first()
        if not user:
            user = User(name='flexget', password='******')
            session.add(user)
            session.commit()
        return APIClient(user.token)
Example #2
0
def api_key(session=None):
    user = session.query(User).first()
    if not user:
        user = User(name='flexget', password='******')
        session.add(user)
        session.commit()

    return user.token