#15887 closed Cleanup/optimization (fixed)
Improve django.views.decorators.http docs
Reported by: | Roy Smith | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | cg@…, mathieu.agopian@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
require_http_methods() require_GET() require_POST()
None of these describe what happens if you try to access the view with the wrong method. Throw some exception? Return a 404? Cause daemons to fly out of your nose? Some additional clarity here would be useful.
Attachments (3)
Change History (13)
comment:1 by , 14 years ago
Cc: | added |
---|---|
Component: | Core (Other) → Documentation |
Has patch: | set |
Type: | Bug → Cleanup/optimization |
by , 14 years ago
Attachment: | fix_15887.diff added |
---|
comment:2 by , 14 years ago
If you are intimately familiar with HTTP, that might be obvious. I wasn't even aware the 405 code existed, so it took me a bit of experimenting to discover what it did, then some research to look up what the 405 code meant. Once I found the "Method Not Allowed" explanation, it was obvious in hind sight, but having the docs say that would have saved me a bunch of time. So, yes, I think it's "really required".
comment:3 by , 14 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
I've changed this ticket as accepted, as there's an explanation and even a doc path. Please let me know if this was to much of a bold move from me.
I've also set the "easy pickings" bit as i believe it's a pretty straightforward issue and fix.
comment:4 by , 14 years ago
Thanks. But, change "This decorators will return" to "These decorators will return" :-)
follow-up: 8 comment:5 by , 14 years ago
Patch needs improvement: | set |
---|
I've attached a the documentation patch with the typo fixed. Could some please check this and remove the "patch needs improvement" if the fixed patch is ok?
comment:6 by , 14 years ago
Cc: | added |
---|
by , 14 years ago
Attachment: | fix_15887.3.diff added |
---|
comment:7 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 14 years ago
Replying to Mathieu Agopian <mathieu.agopian@…>:
I've attached a the documentation patch with the typo fixed. Could some please check this and remove the "patch needs improvement" if the fixed patch is ok?
Thanks for fixing the typo ;)
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [16139]:
(The changeset message doesn't reference this ticket)
They return a proper 405 (Not Allowed) response. If it's really required to note this I created a small patch to mention the return value.