Пример #1
0
def vote_down_answer(question_id, answer_id):
    if session['id']:
        user_id = session['id']
    else:
        pass
    data_manager.vote_down_answer(answer_id, -1, user_id)
    return redirect("/list/question/" + question_id)
Пример #2
0
def vote_down_answer(answer_id):
    data_manager.vote_down_answer(answer_id)
    question_id = data_manager.get_question_id_by_answer_id(
        answer_id)['question_id']
    user_id = data_manager.get_display_question(question_id)['user_id']
    reputation = data_manager.get_reputation(user_id=user_id)
    data_manager.update_reputation(user_id, (reputation - 2))
    return redirect('/question/' + str(question_id))
Пример #3
0
def vote_down_answer(answer_id):
    data_manager.vote_down_answer(answer_id)
    user_id = data_manager.get_answer_owner(answer_id)
    if user_id == None:
        return redirect(request.referrer)
    else:
        owner_user = data_manager.get_user_name_after_id(user_id)
        vote = -1
        data_manager.edit_reputation(vote, 'answer', owner_user)
        return redirect(request.referrer)
Пример #4
0
def vote_down_answer(question_id, answer_id):
    if request.method == 'POST':
        data_manager.vote_down_answer(question_id, answer_id)
        return redirect(url_for('route_question_id', question_id=question_id))
Пример #5
0
def vote_down_answer(answer_id: int):
    question_id = data_manager.get_question_id_by_answer_id(answer_id)
    question_id = question_id[0].get('id')
    data_manager.vote_down_answer(answer_id)
    return redirect(url_for('show_specific_question', question_id=question_id))
Пример #6
0
def vote_down_answer(answer_id):
    id_ = data_manager.get_question_by_answer(answer_id)
    data_manager.vote_down_answer(answer_id)
    return redirect(url_for('route_question', question_id=id_))
Пример #7
0
def A_vote_down(answer_id):
    data_manager.vote_down_answer(answer_id)
    return redirect(request.referrer)
Пример #8
0
def vote_down_answer(answer_id):
    data_manager.vote_down_answer(answer_id)
    question_id = data_manager.get_question_id_from_answer(answer_id)

    return redirect(f'/question/{question_id}')