Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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)

fix_15887.diff (607 bytes ) - added by Christopher Grebs 14 years ago.
fix_15887.2.diff (608 bytes ) - added by Mathieu Agopian <mathieu.agopian@…> 14 years ago.
fixed typo
fix_15887.3.diff (587 bytes ) - added by dmclain 14 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Christopher Grebs, 14 years ago

Cc: cg@… added
Component: Core (Other)Documentation
Has patch: set
Type: BugCleanup/optimization

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.

by Christopher Grebs, 14 years ago

Attachment: fix_15887.diff added

comment:2 by anonymous, 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 Mathieu Agopian <mathieu.agopian@…>, 14 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

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 Roy Smith, 14 years ago

Thanks. But, change "This decorators will return" to "These decorators will return" :-)

by Mathieu Agopian <mathieu.agopian@…>, 14 years ago

Attachment: fix_15887.2.diff added

fixed typo

comment:5 by Mathieu Agopian <mathieu.agopian@…>, 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 Mathieu Agopian, 14 years ago

Cc: mathieu.agopian@… added

by dmclain, 14 years ago

Attachment: fix_15887.3.diff added

comment:7 by Aymeric Augustin, 14 years ago

Triage Stage: AcceptedReady for checkin

in reply to:  5 comment:8 by cg@…, 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 Tim Graham, 14 years ago

Resolution: fixed
Status: newclosed

In [16139]:

(The changeset message doesn't reference this ticket)

comment:10 by Tim Graham, 14 years ago

In [16140]:

[1.3.X] Fixed #15887 - Added clarification for required_*() decorators; thanks RoySmith for the sugggestion.

Backport of r16139 from trunk.

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