History view of AdminSite doesn't take in account user defined queryset
|Reported by:||t2y||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
I found a bug which does not show history view in AdminSite when I defined a queryset for multi-db.
The history_view method of django.contrib.admin.ModelAdmin give a model object to get_object_or_404 as an argument. In that case, normal queryset of the model is used even if user defined custom queryset for the model. It means that the history view isn't showed for multi-db since it define custom queryset.
I made a patch, but I have no idea for making tests code. I only tested after I did some table operation, and I confirmed the history view.
Additionally, you might wonder about the LogEntry(django_admin_log). I think it's no problem since I can handle LogEntry to read/write with db-router.
Change History (11)
Changed 6 years ago by t2y
comment:1 Changed 6 years ago by russellm
- Component changed from ORM aggregation to django.contrib.admin
- Needs documentation unset
- Needs tests set
- Owner set to nobody
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted