Exemplo n.º 1
0
def auth_info():

    form = UserForm(request.form)
    user = User.query.get(current_user.id)

    if not form.validate():
        return render_template("auth/information.html",
                               form=UserForm(),
                               tasks=Task.find_users_tasks(current_user.id))

    if form.name.data:
        user.name = form.name.data

    if form.username.data:
        if not User.unique_username(form.username.data):
            user.username = form.username.data

    if form.password.data:
        user.password = form.password.data

    db.session().commit()

    return redirect(url_for("auth_information"))
Exemplo n.º 2
0
def auth_information():

    return render_template("auth/information.html",
                           form=UserForm(),
                           tasks=Task.find_users_tasks(current_user.id))