Exemplo n.º 1
0
def create_editor(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    role = Role.query.filter_by(name='editor').first()
    if not role:
        role = Role('editor', 'editor role')
        role.save()
    user.roles.append(role)
    user.save()
Exemplo n.º 2
0
def create_editor(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    role = Role.query.filter_by(name='editor').first()
    if not role:
        role = Role('editor', 'editor role')
        role.save()
    user.roles.append(role)
    user.save()
Exemplo n.º 3
0
def create_admin(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    role = Role.query.filter_by(name="admin").first()
    if not role:
        role = Role("admin", "admin role")
        role.save()
    user.roles.append(role)
    role = Role.query.filter_by(name="editor").first()
    if not role:
        role = Role("editor", "editor role")
        role.save()
    user.roles.append(role)
    user.save()
Exemplo n.º 4
0
def create_admin(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    user.save()
    role = Role.query.filter_by(name='admin').first()
    if not role:
        role = Role()
        role.name = 'admin'
        role.description = 'admin role'
        role.save()
    user.roles.append(role)
    role = Role.query.filter_by(name='editor').first()
    if not role:
        role = Role()
        role.name = 'editor'
        role.description = 'editor role'
        role.save()
    user.roles.append(role)
    user.save()
Exemplo n.º 5
0
def create_admin(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    user.save()
    role = Role.query.filter_by(name='admin').first()
    if not role:
        role = Role()
        role.name = 'admin'
        role.description = 'admin role'
        role.save()
    user.roles.append(role)
    role = Role.query.filter_by(name='editor').first()
    if not role:
        role = Role()
        role.name = 'editor'
        role.description = 'editor role'
        role.save()
    user.roles.append(role)
    user.save()
Exemplo n.º 6
0
def create_common_user(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    user.save()
Exemplo n.º 7
0
def create_common_user(name, password, email):
    user = User.create_user(name, email, password)
    profile = UserProfile()
    profile.save()
    user.profile = profile
    user.save()