Commits

Josh Ourisman committed 136476e

setting the error on the form rather than raising an exception

Comments (0)

Files changed (1)

invitation/views.py

             # imports this file.
             return HttpResponseRedirect(success_url or reverse('invitation_complete'))
         else:
-            raise ValidationError('You do not have any invitations left!')
+            form._errors["email"] = form.error_class("You have no invitations left!")
     else:
         form = form_class()
     extra_context.update({