예제 #1
0
def save():
    users = Provider().users()
    if users.count() > 0:
        flash('Application has already been configured', 'error')
        return redirect(url_for('home.index'))

    username = request.form['username'].strip().lower()
    password = request.form['password'].strip()
    full_name = request.form['full_name'].strip()
    email = request.form['email'].strip()

    if len(username) == 0 or len(password) == 0 or len(full_name) == 0 or len(
            email) == 0:
        flash('Please fill in all the fields', 'error')
        return redirect(url_for('install.index'))

    if not users.save(0, username, password, full_name, email, True, False,
                      True):
        flash('Could not create user: '******'error')
        return redirect(url_for('install.index'))

    flash('Please login as the newly created administrator', 'success')
    return redirect(url_for('home.index'))
예제 #2
0
def cli_settings_get(name, value):
    settings = Provider().settings()

    settings.save(name, value)
    print("OK")
    return True