Ticket #7510: use_queryset_in_delete_view_and_change_view_for_ModelAdmin.diff
File use_queryset_in_delete_view_and_change_view_for_ModelAdmin.diff, 1.6 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
550 550 app_label = opts.app_label 551 551 552 552 try: 553 obj = model._default_manager.get(pk=object_id)553 obj = self.queryset(request).get(pk=object_id) 554 554 except model.DoesNotExist: 555 555 # Don't raise Http404 just yet, because we haven't checked 556 556 # permissions yet. We don't want an unauthenticated user to be able … … 662 662 app_label = opts.app_label 663 663 664 664 try: 665 obj = self. model._default_manager.get(pk=object_id)665 obj = self.queryset(request).get(pk=object_id) 666 666 except self.model.DoesNotExist: 667 667 # Don't raise Http404 just yet, because we haven't checked 668 668 # permissions yet. We don't want an unauthenticated user to be able … … 719 719 content_type__id__exact = ContentType.objects.get_for_model(model).id 720 720 ).select_related().order_by('action_time') 721 721 # If no history was found, see whether this object even exists. 722 obj = get_object_or_404(model, pk=object_id) 722 try: 723 obj = self.queryset(request).get(pk=object_id) 724 except model.DoesNotExist: 725 raise Http404('No %s matches the given query.' % model._meta.object_name) 723 726 context = { 724 727 'title': _('Change history: %s') % force_unicode(obj), 725 728 'action_list': action_list,