Beispiel #1
0
def delete_comment(comment_id):
    question_id = data_logic.get_question_id(comment_id=comment_id)
    if request.method == 'GET':
        return render_template('confirm.html',
                               comment_id=comment_id,
                               question_id=question_id)
    else:
        data_logic.delete_data(comment_id, 'comment')
        return redirect(url_for('display_question', question_id=question_id))
Beispiel #2
0
def delete_answer(answer_id, question_id):
    data_logic.delete_all_comments(answer_id=answer_id)
    data_logic.delete_data(answer_id, 'answer')
    return redirect("/questions/" + str(question_id))
Beispiel #3
0
def delete_question(question_id):
    data_logic.delete_all_comments(question_id=question_id)
    data_logic.delete_question_answers(question_id)
    data_logic.delete_data(question_id, 'question')
    return redirect('/')