The chapter "Write a simple form" produces code with bad Choice.DoesNotExist handling
|Reported by:||tobami||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you code the “polls/detail.html” template and the "mysite/polls/views.py" vote() function as in the tutorial, after voting without choosing an option, a DoesNotExist exception is raised and the poll voting form is redisplayed with a "You didn't select a choice." message. The problem is that you cannot try to vote a second time, because the redisplayed page is not "polls/1/" but "polls/1/vote/".
- Complete tutorial 1 to 4 (for Django 1.0.2)
- go to "http://localhost:8000/polls/1/"
- Click vote without selecting a Choice
- The page will be polls/1/vote/, not polls/1/ again
- Try to vote (or not, just click again vote)
It fails because it tries to access "polls/1/vote/vote/"