Opened 17 years ago

Last modified 17 years ago

#3875 closed

Addition of HttpResponseBadRequest (HTTP Status code 400) — at Version 2

Reported by: Scott Barr <scott@…> Owned by: Jacob
Component: Uncategorized Version: dev
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/__init__.py
===================================================================
--- django/http/__init__.py     (revision 4839)
+++ django/http/__init__.py     (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)

Change History (3)

by Scott Barr <scott@…>, 17 years ago

Attachment: patch.txt added

file containing the patch

comment:1 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 17 years ago

Description: modified (diff)

Fixed formatting.

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