[Django] #36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()

24 views
Skip to first unread message

Django

unread,
Mar 9, 2026, 6:56:03 AMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Type: Bug
Status: new | Component:
| contrib.contenttypes
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
The `ModelAdmin.get_exclude()` hook was added in #24941, however,
`GenericInlineModelAdmin`
[https://github.com/django/django/blob/787166fe27b0e7c7f97505da5766cfa72e76ae25/django/contrib/contenttypes/admin.py#L103
doesn't use it].
--
Ticket URL: <https://code.djangoproject.com/ticket/36979>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 9, 2026, 11:01:51 AMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
--------------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.contenttypes | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Favorite):

* stage: Unreviewed => Accepted
* type: Bug => Cleanup/optimization

Comment:

Going to move this triage to accepted, I would recommend someone who knows
more about the admin model to go and fix it. I’m also going to change the
status to clean up just because the feature is working just not using the
efficient function. Good luck!
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:1>

Django

unread,
Mar 9, 2026, 1:01:07 PMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
Type: | MADESHIYA
Cleanup/optimization | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MANAS MADESHIYA):

* cc: MANAS MADESHIYA (added)
* owner: (none) => MANAS MADESHIYA
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:2>

Django

unread,
Mar 9, 2026, 1:31:01 PMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
Type: | MADESHIYA
Cleanup/optimization | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MANAS MADESHIYA):

* has_patch: 0 => 1

Comment:

I have submitted a PR for this ticket:
[https://github.com/django/django/pull/20883 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:3>

Django

unread,
Mar 9, 2026, 5:07:56 PMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
Type: | MADESHIYA
Cleanup/optimization | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Elias Stinson):

* needs_docs: 0 => 1
* stage: Accepted => Ready for checkin

Comment:

The PR looks great, and I'll just recommend to add yourself to the
contributors section, just for your own benefit. Someone else can check me
on this, but I think this would warrant creating a documentation page for
this, as the feature I don't think has one already, or at least it should
be improved to now state that the function is called by django. Anyways,
I'll mark it both for ready to checkin, and needs documentation for said
fix.
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:4>

Django

unread,
Mar 9, 2026, 5:22:35 PMMar 9
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
Type: | MADESHIYA
Cleanup/optimization | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_docs: 1 => 0
* stage: Ready for checkin => Accepted

Comment:

If you're suggesting the patch needs documentation, that's inconsistent
with marking it Ready for Checkin.

I'm going to second the advice I just mentioned in another ticket to ask
you to slow down and read the triage workflow docs, and reduce the
frequency of your participation until you demonstrate more understadning.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:5>

Django

unread,
Mar 12, 2026, 3:52:20 PMMar 12
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
--------------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.contenttypes | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Jacob Walls):

* has_patch: 1 => 0
* owner: MANAS MADESHIYA => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:6>

Django

unread,
Mar 12, 2026, 11:10:47 PMMar 12
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
--------------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.contenttypes | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by MANAS MADESHIYA):

Hi @jacobtylerwalls ,

I apologize for the incomplete AI disclosure.
I used Claude (claude.ai) as an AI assistant
while working on this fix. I reviewed and
verified all code changes myself and ran
the full test suite locally (21 tests passing).

I would like to submit a new PR with proper
disclosure. May I do so?

Thank you for your patience.
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:7>

Django

unread,
Mar 13, 2026, 12:54:38 PMMar 13
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
Type: | MADESHIYA
Cleanup/optimization | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1
* owner: (none) => MANAS MADESHIYA
* status: new => assigned

Comment:

Original PR reopened.
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:8>

Django

unread,
Jun 11, 2026, 10:41:52 AMJun 11
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
| MADESHIYA
Type: Bug | Status: assigned
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin
* type: Cleanup/optimization => Bug

--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:9>

Django

unread,
Jun 11, 2026, 11:02:48 AMJun 11
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
| MADESHIYA
Type: Bug | Status: closed
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"e1df3950b2a3a852dfa9eb70738b7bac28cb0a0e" e1df395]:
{{{#!CommitTicketReference repository=""
revision="e1df3950b2a3a852dfa9eb70738b7bac28cb0a0e"
Fixed #36979 -- Made GenericInlineModelAdmin.get_formset() use
get_exclude().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:10>

Django

unread,
Jun 11, 2026, 11:03:40 AMJun 11
to django-...@googlegroups.com
#36979: GenericInlineModelAdmin doesn't respect ModelAdmin.get_exclude()
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: MANAS
| MADESHIYA
Type: Bug | Status: closed
Component: | Version: 6.0
contrib.contenttypes |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"f51bdd91254314d33db13b4f736389250a1a7c5e" f51bdd9]:
{{{#!CommitTicketReference repository=""
revision="f51bdd91254314d33db13b4f736389250a1a7c5e"
[6.1.x] Fixed #36979 -- Made GenericInlineModelAdmin.get_formset() use
get_exclude().

Backport of e1df3950b2a3a852dfa9eb70738b7bac28cb0a0e from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36979#comment:11>
Reply all
Reply to author
Forward
0 new messages