mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #21013 -- Ensure that ModelAdmin.get_queryset is considered for the admin history view.
This commit is contained in:
committed by
Julien Phalip
parent
e192739b3e
commit
04415bf81b
@@ -1537,7 +1537,7 @@ class ModelAdmin(BaseModelAdmin):
|
||||
from django.contrib.admin.models import LogEntry
|
||||
# First check if the user can see this history.
|
||||
model = self.model
|
||||
obj = get_object_or_404(model, pk=unquote(object_id))
|
||||
obj = get_object_or_404(self.get_queryset(request), pk=unquote(object_id))
|
||||
|
||||
if not self.has_change_permission(request, obj):
|
||||
raise PermissionDenied
|
||||
|
||||
Reference in New Issue
Block a user