Opened 13 years ago

Last modified 21 months ago

#17726 new Bug

Admin's Recent Actions broken for multiple admin site instances with unique registered models

Reported by: Steven MacLeod Owned by: nobody
Component: contrib.admin Version: 4.1
Severity: Normal Keywords: admin, multiple admin sites, recent actions
Cc: chipx86@…, Al Mahdi Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The Recent Actions list contains actions carried out from all admin site instances a user has access to. This causes problems when there exists a model which is not registered in all instances, and a User with access to multiple instances. If an action is carried out on this model it will appear in the recent list of all admin sites. If the model is not registered to an instance, the link generated will be invalid.

Ex:

  • AdminSite1 has model Model1 registered
  • AdminSite2 does not have Model1 registered
  • User has access to both admin sites
  • User adds a Model1 in AdminSite1 (Action1)
  • User visits AdminSite2, and clicks the Action1 link
  • User is directed to an invalid URL (url for Model1 in AdminSite2)

Change History (9)

comment:1 by Christian Hammond, 13 years ago

Cc: chipx86@… added

comment:2 by Aymeric Augustin, 13 years ago

Type: UncategorizedBug

comment:3 by Julien Phalip, 13 years ago

Resolution: duplicate
Status: newclosed

Thanks for the report, however this is a duplicate of #9151, which was wontfixed. If you disagree with this resolution, please take this question to django-developers.

comment:4 by Carl Meyer, 13 years ago

Resolution: duplicate
Status: closedreopened
Triage Stage: UnreviewedAccepted

I don't believe this is actually a duplicate of #9151, though it is similar. #9151 is about django.contrib.sites; this ticket is about creating multiple instances of django.contrib.admin.Site. Despite the confusing naming, those are two completely separate things. And I don't think the wontfix reasoning applied in #9151 applies here; while there may be nothing about django.contrib.sites.models.Site that warrants special treatment in the admin, I think it's reasonable to expect that the admin's *own* multiple-admin-site feature won't break the admin's own recent-actions feature.

Reopening.

comment:5 by Aymeric Augustin, 12 years ago

Status: reopenednew

comment:6 by Mariusz Felisiak, 2 years ago

#34162 was a duplicate for resolving URLs for a custom admin site.

comment:7 by Al Mahdi, 21 months ago

Still not fixed in 4.1

https://github.com/django/django/blob/d3edac6c071c544c7d2208baf13d6d0fdc5e58fe/django/contrib/admin/models.py#L182

LogEntry.get_admin_url method reverse(s) entries with default admin: prefix

comment:8 by Al Mahdi, 21 months ago

Cc: Al Mahdi added

comment:9 by Al Mahdi, 21 months ago

Version: 1.34.1
Note: See TracTickets for help on using tickets.
Back to Top