Opened 3 years ago
Closed 3 years ago
#33592 closed Bug (fixed)
view_on_site redirect does not work for custom admin site.
Reported by: | Stefan Wehrmeyer | Owned by: | Stefan Wehrmeyer |
---|---|---|---|
Component: | contrib.admin | Version: | 4.0 |
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
All reverse
calls in contrib/admin/options.py
have a current_app
keyword argument, so they resolve with the current (possibly custom) admin site – except the reverse
call in get_view_on_site_url
. This lead to custom admin sites using the default admin to redirect via `view_on_site.
This is clearly a bug. When the default admin is handled with extra protections outside of Django (e.g. additional basic auth), users of the custom admin cannot use the "view on site" link because it routes through the default admin.
Patch is easy and already here: https://github.com/django/django/pull/15526
I'll try to provide a regression test as well.
Change History (5)
comment:1 by , 3 years ago
Has patch: | set |
---|---|
Needs tests: | set |
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 3 years ago
Summary: | `view_on_site` redirect does not work for custom admin site → view_on_site redirect does not work for custom admin site. |
---|
comment:3 by , 3 years ago
Needs tests: | unset |
---|
Test has been added to PR: https://github.com/django/django/pull/15526
comment:4 by , 3 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Thanks