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