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.
* status: new => closed
* resolution: => duplicate
Comment:
Thanks for the ticket, I think we can mark this as a duplicate of #17726.
Resolving URLs to a proper admin site should fix both issues.
--
Ticket URL: <https://code.djangoproject.com/ticket/34162#comment:1>
Comment (by Rigoberto Villalta):
I don´t think is duplicate.
What the ticket [https://code.djangoproject.com/ticket/17726 #17726]
alleges is that if you change a {{{Model}}} A in a custom {{{Admin Site}}}
and this {{{Model}}} is not register in other {{{Admin Site}}} instance,
this shouldn't appear in the index of the other {{{Admin Site}}} instance.
What I am trying to fix is that at least to point the {{{Logentry}}} in
the index to the current {{{Admin Site}}}.
I most said this bug only happens if you register the Default Admin Site
in the project's {{{url.py}}} file:
{{{
path("super_admin/", admin.site.urls)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34162#comment:2>
Comment (by Mariusz Felisiak):
Replying to [comment:2 Rigoberto Villalta]:
> I don´t think is duplicate.
It's not exactly the same but resolving URLs to a proper admin site would
fix both issues.
--
Ticket URL: <https://code.djangoproject.com/ticket/34162#comment:3>