Beispiel #1
0
def make_question_comment(request):
    if request.method == "GET":
        raise Http404
    if request.method == "POST":
        form = CommentForm(request.POST)
        user = request.user.userprofile

        question_service = QuestionServices()
        comment = question_service.create_comment(form.data['comment'], form.data['question_id'], user)        
        return HttpResponseRedirect('/question/' + form.data['question_id'] + '?comment=' + str(comment.id))
Beispiel #2
0
def make_question_comment(request):
    if request.method == "GET":
        raise Http404
    if request.method == "POST":
        form = CommentForm(request.POST)
        user = request.user.userprofile

        question_service = QuestionServices()
        comment = question_service.create_comment(form.data['comment'],
                                                  form.data['question_id'],
                                                  user)
        return HttpResponseRedirect('/question/' + form.data['question_id'] +
                                    '?comment=' + str(comment.id))