Beispiel #1
0
def add_author():
    if not session.get("logged"):
        abort(401)
    form = form_handler.AddAuthorForm(request.form)
    if request.method == "POST" and form.validate():
        db_handler.add_author(form.name.data)
        flash("New author save successfully")
        return redirect(url_for('index'))
    return render_template("add_author.html", form=form)
Beispiel #2
0
def add_author():
    if not session.get("logged"):
        abort(401)
    form = form_handler.AddAuthorForm(request.form)
    if request.method == "POST" and form.validate():
        db_handler.add_author(form.name.data)
        flash("New author save successfully")
        return redirect(url_for('index'))
    return render_template("add_author.html", form=form)