def __import_users():
    session = session_factory.create_session()
    if session.query(User).count() > 0:
        return

    data_service.get_default_user()

    user2 = User()
    user2.email = "*****@*****.**"
    user2.name = "user 2"
    session.add(user2)
    session.commit()
def __import_users():
    session = session_factory.create_session()
    if session.query(User).count() > 0:
        return

    data_service.get_default_user()

    user2 = User()
    user2.email = '*****@*****.**'
    user2.name = 'Natalia'
    session.add(user2)
    session.commit()
Beispiel #3
0
def get_default_user():
    session = session_factory.create_session()

    user = session.query(User).filter(User.email == "*****@*****.**").first()
    if user:
        return user

    user = User()
    user.name = "Test user 1"
    user.email = "*****@*****.**"
    session.add(user)

    session.commit()

    return user
Beispiel #4
0
def get_default_user():
    session = session_factory.create_session()

    user = session.query(User).filter(User.email == '*****@*****.**').first()
    if user:
        return user

    user = User()
    user.email = '*****@*****.**'
    user.name = 'Ruslan'
    session.add(user)

    session.commit()

    return user
    def post(self):
        args = parser.parse_args()
        session = db_session.create_session()
        user = User()

        user.id = args['id']
        user.name = args['name']
        user.email = args['email']
        user.role = args['role']
        user.avatar_path = args['avatar_path']
        user.set_password(args['password'])

        session.add(user)
        session.commit()
        return jsonify({'message': 'SUCCESS'})
Beispiel #6
0
def get_default_user():
    session = session_factory.create_session()

    user = session.query(User).filter(User.email == '*****@*****.**').first()
    if user:
        return user

    user = User()
    user.email = '*****@*****.**'
    user.name = 'test user 1'
    session.add(user)

    session.commit()

    return user