Ticket #2429: tutorial4.diff

File tutorial4.diff, 566 bytes (added by anonymous, 18 years ago)

Correction in the example code

  • tutorial04.txt

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