Opened 19 years ago
Closed 19 years ago
#2185 closed defect (fixed)
require_http_methods "raise"s HttpResponseForbidden
Reported by: | Owned by: | Malcolm Tredinnick | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Maniac@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django.views.decorators.http.require_http_methods in case of invalid method "raise"s an instance of HttpResponseForbidden which is not an Exception. Now it ends up in a form of 500 error.
I think we need an exceptions similar to Http404 for this case. Not sure if it should be called Http403 or HttpForbidden...
Change History (6)
comment:1 by , 19 years ago
Cc: | added |
---|
comment:2 by , 19 years ago
comment:3 by , 19 years ago
Owner: | changed from | to
---|
comment:4 by , 19 years ago
BTW if the decorator would just return HttpResponseNotAlowed with some default message this won't be localizable (nor pretty). I'm starting to think that all "negative" HTTP answers should be treated like 404 and 500 now, allowing for custom template and view.
comment:5 by , 19 years ago
The 405 error typically does not have a body, just a list of HTTP methods that *are* acceptable in a subsequent retry. So this doesn't have any internationalization impact.
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This will be fixed by #1646 (which is on my list to commit shortly).