hello, I'm making a simple vote class, where a user can vote up or vote down an answer. I don't want this function to return anything,as the vote for every user is created when he votes. The problem is that my redirection, or empty return gives me an error like: The page isn't redirecting properly from browser.
My code:
def vote_answer_down(request,id):
answer = Answer.objects.get(pk = id)
VoteDownAnswer.objects.create(answer = answer, voted_down_by = request.user)
return HttpResponseRedirect('.') #or return (without httpresponse),gives the same
where am i wrong? Thanks!