#30980: admin.E130 (duplicate __name__ attributes of actions) should specify
which
were duplicated
------------------------------------------------+------------------------
Reporter: Keryn Knight | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: master
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 fact that the `__name__` is used is somewhat an implementation detail,
and there's no guarantee the user has enough of an understanding of python
to know what that attribute is, let alone how to fix it.
This just came up on IRC because a user had defined `actions =
[delete_selected]` where `delete_selected` was a reference to their own
callable, but shares the name of the base one (and by specifying the
`actions = ` they were assuming that they were wholesale replacing the
actions list, where that may not be true for site-wide actions) so errored
... but they only had define a list of `len(...) == 1` so how can there be
a duplicate (is their thought process)?
The error message should specify those names that occur 2> (rather than
just check `len(...)` vs `len(set(...))`), and ought ideally to explain
where the duplicate comes from (ie: AdminSite-wide).
Related ticket about E130: #30311 (+ those it references) but is about the
replacement strategy rather than the error message itself.
--
Ticket URL: <https://code.djangoproject.com/ticket/30980>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.53c41c9bf551ed0d125006d377e9481d%40djangoproject.com.