Exemplo n.º 1
0
def delete_resepti(resepti_id):
    if current_user.user_group != 0:
        flash("Deleting is for admin users")
        return render_template("index.html")
    poistettava = Resepti.query.get(resepti_id)
    db.session.delete(poistettava)
    db.session.commit()
    Ainesosa.clean_ainesosat()
    ainesosaCount = Resepti.find_resepti_ainesosa_count()
    return render_template("reseptit/list.html",
                           reseptit=Resepti.query.all(),
                           ainesosaCount=ainesosaCount)
Exemplo n.º 2
0
def reseptit_index():
    ainesosaCount = Resepti.find_resepti_ainesosa_count()
    return render_template("reseptit/list.html",
                           reseptit=Resepti.query.all(),
                           ainesosaCount=ainesosaCount)