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()
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()
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()
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()