diff --git a/sondage/views.py b/sondage/views.py index 0d47ab9e92093d2b9f5a41aca36f6890eb6bde91..a2d46d77782453670618acb73fa594a7fbbf4f8d 100644 --- a/sondage/views.py +++ b/sondage/views.py @@ -188,10 +188,9 @@ def vote(request, poll_id): return HttpResponse(vorm.cleaned_data['choice']) if not Vote.objects.filter(choice=choice,bulletin=bulletin): - vorm.cleaned_data['choice'] = choice - new = vorm.save(commit=False) - new.bulletin = bulletin - #new.choice = choice + new = Vote(choice=choice,bulletin=bulletin,comment=vorm.cleaned_data['comment']) + if vorm.cleaned_data['voice']: + new.voice = vorm.cleaned_data['voice'] new.save() if new.voice: choice.votecount += 1