Ejemplo n.º 1
0
def create_user(mycodo_db, role_id, name, password):
    """ Create fake admin user """
    new_user = UserFactory()
    new_user.name = name
    new_user.set_password(password)
    new_user.role_id = role_id
    mycodo_db.add(new_user)
    mycodo_db.commit()
    return new_user
Ejemplo n.º 2
0
def create_user(mycodo_db, role_id, name, password):
    """ Create fake admin user """
    new_user = UserFactory()
    new_user.name = name
    new_user.set_password(password)
    new_user.role_id = role_id
    mycodo_db.add(new_user)
    mycodo_db.commit()
    return new_user
def create_guest_user():
    """ Create a guest user if it doesn't exist """
    if not User.query.filter_by(name='guest').count():
        user = UserFactory()
        user.name = 'guest'
        user.email = '*****@*****.**'
        user.set_password('53CR3t_p4zZW0rD')
        user.role = Role.query.filter_by(name='Guest').first().id
        user.save()
def create_admin_user():
    """ Create an admin user if it doesn't exist """
    if not User.query.filter_by(name='admin').count():
        user = UserFactory()
        user.name = 'admin'
        user.set_password('53CR3t_p4zZW0rD')
        user.save()
        user.role = Role.query.filter_by(name='Admin').first().id
        user.save()
Ejemplo n.º 5
0
def create_guest_user():
    """ Create a guest user if it doesn't exist """
    if not User.query.filter_by(name='guest').count():
        user = UserFactory()
        user.name = 'guest'
        user.email = '*****@*****.**'
        user.set_password('53CR3t_p4zZW0rD')
        user.role_id = Role.query.filter_by(name='Guest').first().id
        user.language = 'en'
        user.save()
Ejemplo n.º 6
0
def create_admin_user():
    """ Create an admin user if it doesn't exist """
    if not User.query.filter_by(name='admin').count():
        user = UserFactory()
        user.name = 'admin'
        user.set_password('53CR3t_p4zZW0rD')
        user.language = 'en'
        user.save()
        user.role_id = Role.query.filter_by(name='Admin').first().id
        user.save()
Ejemplo n.º 7
0
def create_admin_user():
    """Create an admin user if it doesn't exist."""
    if not User.query.filter_by(name='admin').count():
        user = UserFactory()
        user.name = 'admin'
        user.set_password('53CR3t_p4zZW0rD')
        user.api_key = b'secret_admin_api_key'
        user.language = 'en'
        user.save()
        user.role_id = Role.query.filter_by(name='Admin').first().id
        user.save()