#20447 closed New feature (fixed)
next_page parameter in logout function does not recognize named urls
| Reported by: | caumons | Owned by: | Baptiste Mispelon |
|---|---|---|---|
| Component: | contrib.auth | Version: | 1.5 |
| Severity: | Normal | Keywords: | |
| Cc: | bmispelon@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When using logout function:
logout(request[, next_page, template_name, redirect_field_name])
next_page parameter does not recognize named urls, it appends the name at the end of the current URL. E.g. if your "/" URL is named "home", then using "home" as the next_page will result in the URL /logout/home
If this won't be fixed, at least mention it in the docs. Thanks!
Change History (5)
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 12 years ago
| Cc: | added |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
| Type: | Bug → New feature |
The login and logout views don't actually work exactly the same way. You can't pass a next_page parameter to login (you can configure settings.LOGIN_REDIRECT_URL or pass a parameter in the request).
Still, this seems like a reasonable and useful feature, which wouldn't be hard to implement. I don't foresee any backwards-compatibility issues either.
comment:3 by , 12 years ago
| Has patch: | set |
|---|
Pull request here: https://github.com/django/django/pull/1157
comment:4 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:5 by , 12 years ago
Thanks to you for the fast fix!
I installed Django with pip command. Can I get this update into the current installed version or should I use a clone of the development version?
Thanks! :)
This seems fair.The corresponding
loginview does callresolve_urlto lookup a variety of ways to express the URL but thelogoutview does not.Either we need to make things consistent or we need to mention it in the documentation.