def novo_comentario_tratamento(request, id): context = RequestContext(request) author = request.user discussion = Discussion.discussion.get(id=id) if request.method == 'POST': form = CommentTreatmentForm(request.POST) if form.is_valid(): treatment = form.cleaned_data['comment_treatment'] comment = comment_discussion(id, author, "", "", treatment, True) return HttpResponseRedirect(reverse('ver_discussao', args=[discussion.id, discussion.slug])) else: return None
def novo_comentario_diagnostico(request, id): context = RequestContext(request) author = request.user discussion = Discussion.discussion.get(id=id) if request.method == 'POST': form = CommentDiagnosisForm(request.POST) if form.is_valid(): diagnosis = form.cleaned_data['comment_diagnosis'] comment = comment_discussion(id, author, "", diagnosis, "", True) # return HttpResponseRedirect(reverse('home')) return HttpResponseRedirect(reverse('ver_discussao', args=[discussion.id, discussion.slug])) else: return None