示例#1
0
def delete(item_id, is_question):
    if is_question == 'True':
        data_handler.delete_question(item_id)
    else:
        data_handler.delete_answer_comments(item_id)
        data_handler.delete_answer(item_id)
    return redirect('/list')
示例#2
0
def delete_answer(question_id, answer_id):
    answer = data_handler.get_answer_by_id(answer_id)[0]
    if answer['username'] != session['username']:
        return redirect(
            url_for('route_question_by_id', question_id=question_id))

    data_handler.delete_answer(answer_id)
    return redirect(f'/question/{question_id}')
示例#3
0
def route_delete_answer(answer_id):
    question_id = data_handler.get_question_id_from_answer_id(answer_id)
    data_handler.delete_answer(answer_id)
    return redirect(url_for("route_list_answers", question_id=question_id))
示例#4
0
def route_delete_question(question_id):
    for item in data_handler.get_answer_ids_with_question_id(question_id):
        data_handler.delete_answer(item)
    data_handler.delete_question(question_id)
    return redirect('/list')
示例#5
0
def delete_answer(answer_id):
    question_id = data_handler.delete_answer(answer_id, app)
    return redirect(url_for('show_answers', question_id=question_id))
示例#6
0
def del_answer(answer_id):
    question_id = data_handler.get_answer_data_by_answer_id(answer_id)[0]
    data_handler.delete_answer(answer_id)
    return redirect(
        url_for('view_question', question_id=question_id['question_id']))
示例#7
0
def delete_answer(question_id, answer_id):
    data_handler.delete_answer(answer_id)
    return redirect(f'/question/{question_id}')
示例#8
0
def delete_answer(answer_id):
    answer = data_handler.get_selected_answer(answer_id)
    data_handler.delete_answer(answer_id)

    return redirect(url_for('question', question_id=answer['question_id']))