#34162: Wrong URL generated by get_admin_url in admin index "Recent Actions"
panel
in custom Django Admin Site
-----------------------------------------+------------------------
Reporter: Rigo-Villalta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
When a custom Admin Site is generated the method {{{ get_admin_url }}} of
the class {{{ LogEntry }}} in {{{ contrib/admin/models }}} generates a
link to {{{ /admin/... }}} instead of {{{ /custom-admin/... }}}
This is the code of the method:
{{{
if self.content_type and self.object_id:
url_name = "admin:%s_%s_change" % (
self.content_type.app_label,
self.content_type.model,
)
try:
return reverse(url_name, args=(quote(self.object_id),))
}}}
The problem here is that the class LogEntry has not an instance of Admin
Site as in this ticket: [https://code.djangoproject.com/ticket/33077] .
I have tested this bug in Django 3.2, 3.1 and 4.0
--
Ticket URL: <https://code.djangoproject.com/ticket/34162>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701847e2e4528-70bb8ff7-a3f9-434a-9bd5-152a24b07221-000000%40eu-central-1.amazonses.com.