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)
def reseptit_index(): ainesosaCount = Resepti.find_resepti_ainesosa_count() return render_template("reseptit/list.html", reseptit=Resepti.query.all(), ainesosaCount=ainesosaCount)