Ticket #1464: tutorial04.diff

File tutorial04.diff, 579 bytes (added by ubernostrum, 9 years ago)

Patch to fix a problem in tutorial 4

  • tutorial04.txt

     
    5555    def vote(request, poll_id):
    5656        p = get_object_or_404(Poll, pk=poll_id)
    5757        try:
    58             selected_choice = p.choice_set.filter(pk=request.POST['choice'])
     58            selected_choice = p.choice_set.get(pk=request.POST['choice'])
    5959        except (KeyError, Choice.DoesNotExist):
    6060            # Redisplay the poll voting form.
    6161            return render_to_response('polls/detail', {
Back to Top