def post(self, request): if request.POST.get('response', False): response = Response() question = Question.objects.get(id=request.POST['question']) response.message = request.POST['response'] response.question = question response.user = request.user response.save() return HttpResponseRedirect(request.META['HTTP_REFERER'])