* cc: mjtamlyn (added)
* ui_ux: => 0
* easy: => 0
Comment:
I agree with this being an issue - and a weird one to debug too!
I'd extend it to actions as well which would suffer from the same issue.
Whilst it would potentially break some code to change it to a tuple, I
would say this is more correct, an also consistent with the other
attributes such as `list_filter`.
What exactly is the issue with the current implementation?
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Jacob Walls
* needs_better_patch: 1 => 0
* status: new => assigned
* type: Bug => Cleanup/optimization
Comment:
This issue predates the system check framework. Trying the original
example (I created a new class in the `admin_inlines` test suite) now
catches errors before failing at the db layer:
{{{
<class 'admin_inlines.admin.FootNoteAuditInline'>: (admin.E202)
'admin_inlines.FootNoteAudit' has no ForeignKey to
'admin_inlines.ShowInlineParent'.
}}}
> What exactly is the issue with the current implementation?
I think if there is one, it's that folks might believe they can mutate the
`inlines` on ''instances'' of `ModelAdmin`, but that's user error if
they're not willing to accept it applying to all model admins.
[https://github.com/django/django/pull/15270 PR] clarifies the intended
immutability of the `inlines` attribute of `ModelAdmin` by defaulting to
`()`, but we could also just close as user error.
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:5>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"dc9deea8e85641695e489e43ed5d5638134c15c7" dc9deea8]:
{{{
#!CommitTicketReference repository=""
revision="dc9deea8e85641695e489e43ed5d5638134c15c7"
Fixed #11715 -- Changed default value of ModelAdmin.actions/inlines to
empty tuples.
This clarifies the intended pattern of overwriting the default value
rather than mutating it.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/11715#comment:8>