Opened 12 years ago

Closed 12 years ago

#3875 closed (fixed)

Addition of HttpResponseBadRequest (HTTP Status code 400)

Reported by: Scott Barr <scott@…> Owned by: Jacob
Component: Uncategorized Version: master
Severity: Keywords: httpresponse bad request 400
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

The following is a patch to add a class called HttpResponseBadRequest to django.http

Purpose of this class is to provide a HTTP status code 400.

Index: django/http/
--- django/http/     (revision 4839)
+++ django/http/     (working copy)
@@ -291,6 +291,11 @@
         HttpResponse.__init__(self, *args, **kwargs)
         self.status_code = 410
+class HttpResponseBadRequest(HttpResponse):
+    def __init__(self, *args, **kwargs):
+        HttpResponse.__init__(self, *args, **kwargs)
+        self.status_code = 400
 class HttpResponseServerError(HttpResponse):
     def __init__(self, *args, **kwargs):
         HttpResponse.__init__(self, *args, **kwargs)

Attachments (1)

patch.txt (612 bytes) - added by Scott Barr <scott@…> 12 years ago.
file containing the patch

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Scott Barr <scott@…>

Attachment: patch.txt added

file containing the patch

comment:1 Changed 12 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedReady for checkin

comment:2 Changed 12 years ago by Malcolm Tredinnick

Description: modified (diff)

Fixed formatting.

comment:3 Changed 12 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [4866]) Fixed #3875 -- Added HttpResponseBadRequest. Thanks, Scott Barr.

Note: See TracTickets for help on using tickets.
Back to Top