Example #1
0
def create_admin():
    """Create the admin user (if it doesn't already exist)"""
    from pyceo import prompt
    from .manage import create_user

    u = User.by_login(u'admin')
    if not u:
        print 'Creating the `admin` user…'
        email = prompt('>>> `admin` email?\n')
        create_user(u'admin', 'admin', fullname=u'Admin', email=email)
        u = User.by_login(u'admin')

    u.add_role(u'admin')
    db.commit()
    return u
Example #2
0
def create_admin():
    """Create the admin user (if it doesn't already exist)"""
    from pyceo import prompt
    from .manage import create_user

    u = User.by_login(u"admin")
    if not u:
        print "Creating the `admin` user…"
        email = prompt(">>> `admin` email?\n")
        create_user(u"admin", "admin", fullname=u"Admin", email=email)
        u = User.by_login(u"admin")

    u.add_role(u"admin")
    db.commit()
    return u