Permalink
Browse files

Handle submitting question form with no selection made.

We just ignore this situation and present the user with a new question.
  • Loading branch information...
1 parent dcc7b60 commit 41383e8913681e6a2e128f884e4e048705de6fe4 @malcolmt committed Aug 16, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 minerva/views.py
View
@@ -12,8 +12,9 @@ def validate_answer(request):
"""
form = QuestionForm(request.POST)
if not form.is_valid():
- # FIXME: Hmm ... form tampering?! Anything legit? What to do?
- raise Exception(form.errors)
+ # Either form-tampering or submitting without data. In either case,
+ # we'll just ignore it and generate a new question.
+ return {}
data = form.cleaned_data
word = Word.objects.get(id=data["meta"][0])
query = {'word': word}

0 comments on commit 41383e8

Please sign in to comment.