Exemplo n.º 1
0
def propsal_comment_reply(cid, pid):
    from funding.orm.orm import Comment
    c = Comment.find_by_id(cid)
    if not c or c.replied_to:
        return redirect(url_for('proposal', pid=pid))
    p = Proposal.find_by_id(pid)
    if not p:
        return redirect(url_for('proposals'))
    if c.proposal_id != p.id:
        return redirect(url_for('proposals'))

    return make_response(render_template('comment_reply.html', c=c, pid=pid, cid=cid))
Exemplo n.º 2
0
def proposal_comment_edit(cid, pid):
    from funding.orm.orm import Comment
    c = Comment.find_by_id(cid)
    if c.locked:
        raise Exception('comment is locked, cannot edit or delete')
    p = Proposal.find_by_id(pid)
    if not p:
        return redirect(url_for('proposals'))
    if c.proposal_id != p.id:
        return redirect(url_for('proposals'))

    return make_response(
        render_template('comment_edit.html', c=c, pid=pid, cid=cid))