Exemple #1
0
def new_comment_problem(request, problem_id):
    print "inside new_problem_comment."
    print "Here is the POST: ", request.POST.get("content")
    print "Here is the data: ", json.loads(request.body)["content"]
    print "Is is ajax? ", request.is_ajax()
    problem = logic.get_problem(problem_id)
    if request.method == "POST":
        logic.new_comment_problem(request, problem)
    # return HttpResponseRedirect('/problems/' + str(problem_id))
    return HttpResponse(status=200)
Exemple #2
0
def add_comment_to_problem(request, problem_id):
    problem = logic.get_problem(problem_id)
    if request.method == "POST":
        logic.new_comment_problem(request, problem)
    return HttpResponseRedirect("/problems/" + str(problem_id))