Permalink
Browse files

Return 400 if form is invalid

  • Loading branch information...
1 parent 6516ec0 commit 6a3fe8917bde9914157fe18096e14512c25209ab @paltman paltman committed Feb 27, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 boxes/views.py
View
@@ -1,7 +1,7 @@
import json
from django.core.urlresolvers import reverse
-from django.http import HttpResponse, HttpResponseForbidden
+from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.template import RequestContext
from django.template.loader import render_to_string
@@ -18,6 +18,8 @@
@permission_required("boxes.change_box", raise_exception=True)
def box_edit(request, label):
+ if not form.is_valid():
+ return HttpResponseBadRequest() # not sure how this will ever happen
next = request.GET.get("next")

0 comments on commit 6a3fe89

Please sign in to comment.