Exemplo n.º 1
0
def removeComment(comment_id):
    comment = dao.getObject(comment_id, Comment)
    if comment.user != current_user:
        return redirect(request.referrer or url_for('index'))
    dao.deleteObject(comment)
    dao.commit()
    flash("Yorum silindi!", 'info')
    return redirect(request.referrer or url_for('bookPage', book_id=comment.book.id))
Exemplo n.º 2
0
def removeNote(note_id):
    note = dao.getObject(note_id, Note)
    if note.user != current_user:
        return redirect(request.referrer or url_for('index'))
    dao.deleteObject(note)
    dao.commit()
    flash("Not silindi!", 'info')
    return redirect(request.referrer or url_for('bookPage', book_id=note.book.id))
Exemplo n.º 3
0
def deleteSummary(assoc_id):
    assoc = dao.getObject(assoc_id, UserBook)
    if assoc is None or assoc not in current_user.book_assocs or assoc.status != Status.have_read or assoc.summary == None:
        flash(u'Var olmayan bir özeti silemezsiniz!', 'warning')
        return redirect(request.referrer or url_for('index'))
    dao.deleteObject(assoc.summary)
    dao.commit()
    flash(u'Özet silindi!', 'info')
    return redirect(url_for('index'))
Exemplo n.º 4
0
def removeGoal():
    if current_user.reading_goal is not None:
        dao.deleteObject(current_user.reading_goal)
        dao.commit()
    return redirect(url_for('index'))