def trash(): if current_user.is_authenticated: notes = current_user.get_deleted_notes() if len(notes) == 0: flash("Trash is empty, you are so Tidy!") return redirect(url_for('.index')) return render_template('app/trash.html', notes=notes) else: return render_template('index.html')
def empty_trash(): list(map(lambda x: delete_forever(x.id), current_user.get_deleted_notes())) flash("Took out the Trash") return redirect(url_for('.index'))