Пример #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
Пример #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
Пример #3
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()
Пример #4
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()
Пример #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()
Пример #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()