Code

Opened 7 years ago

Closed 7 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: UI/UX:

Description (last modified by mtredinnick)

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)

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

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

file containing the patch

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Description modified (diff)

Fixed formatting.

comment:3 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.