1
0
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:
Juan Catalano
2013-09-06 20:28:48 +00:00
committed by Julien Phalip
parent e192739b3e
commit 04415bf81b
5 changed files with 42 additions and 3 deletions

View File

@@ -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