Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Return 400 if form is invalid

  • Loading branch information...
commit 6a3fe8917bde9914157fe18096e14512c25209ab 1 parent 6516ec0
@paltman paltman authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 boxes/views.py
View
4 boxes/views.py
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.