Ticket #7827: admin-qs.diff

File admin-qs.diff, 1.0 KB (added by Alex Gaynor, 16 years ago)

Problem also exists in the delete_view, this fixes both.

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 3b26f7b..23a355a 100644
    a b class ModelAdmin(BaseModelAdmin):  
    523523        app_label = opts.app_label
    524524
    525525        try:
    526             obj = model._default_manager.get(pk=object_id)
     526            obj = self.queryset(request).get(pk=object_id)
    527527        except model.DoesNotExist:
    528528            # Don't raise Http404 just yet, because we haven't checked
    529529            # permissions yet. We don't want an unauthenticated user to be able
    class ModelAdmin(BaseModelAdmin):  
    621621        app_label = opts.app_label
    622622
    623623        try:
    624             obj = self.model._default_manager.get(pk=object_id)
     624            obj = self.queryset(request).get(pk=object_id)
    625625        except self.model.DoesNotExist:
    626626            # Don't raise Http404 just yet, because we haven't checked
    627627            # permissions yet. We don't want an unauthenticated user to be able
Back to Top