Opened 15 years ago
Closed 14 years ago
#11770 closed (fixed)
Allow login_required to specify login_url like user_passes_test
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Keywords: | login auth | |
Cc: | tomovo@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
All up to login_required Django allows one to specify a custom login_url when the user is not actually logged in.
However, login_required omits this parameter when calling user_passes_test and thus forces me to rewrite that piece of code to do that. I think it would be a simple and probably backwards-compatible change to add an optional parameter to override the login_url even in login_required.
Attachments (1)
Change History (4)
by , 15 years ago
Attachment: | 11770-login-decorator.diff added |
---|
comment:1 by , 15 years ago
Component: | Uncategorized → Authentication |
---|---|
Has patch: | set |
Summary: | Allow login_required to specify a custom login_url → Allow login_required to specify login_url like user_passes_test |
Triage Stage: | Unreviewed → Design decision needed |
Version: | 1.1 → SVN |
This is interesting and pretty trivial IMO. Marking DDN and putting a patch up that I think accomplishes this right and changes the docs. Also adds the other part of the docs for user_passes_test and changes absolute URL to absolute path, both of which should probably be their own tickets.
comment:2 by , 15 years ago
Hi, is there a problem to apply this patch on current working version? It is quite old and trivial. I just need such behaviour of login_required decorator but it is always better to have it from trunk than apply this patch to every update.
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch with desired (assumed) functionality and updated docs