#29212 closed Bug (fixed)
Redirect loop with @permission_required and redirect_authenticated_user
Reported by: | Nick Pope | Owned by: | Nick Pope |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The redirect_authenticated_user
option was added by ticket #12233.
When combined with @permission_required
and the user does not have the specified permission(s), a redirect loop can occur.
We should document (and add tests) for this behaviour and recommend the following pattern to avoid the issue:
@login_required @permission_required('permission', raise_exception=True) def view(request): # ...
Documentation to be updated:
Change History (5)
comment:1 by , 7 years ago
Component: | Uncategorized → Documentation |
---|---|
Has patch: | set |
Owner: | changed from | to
Status: | new → assigned |
Type: | Uncategorized → Bug |
Version: | 2.0 → master |
comment:2 by , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 7 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
PR