#36104: forms.Media shouldn't expect media objects only
-------------------------------------+-------------------------------------
Reporter: Matthias | Owner: Matthias Kestenholz
Kestenholz |
Type: Bug | Status: assigned
Component: Forms | Version: 5.1
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While thinking about
https://forum.djangoproject.com/t/rejuvenating-vs-
deprecating-form-media/21285 I have noticed that the `forms.Media.__add__`
method assumes that media objects are only ever added to each other. That
doesn't necessarily have to be the case.
I propose returning `NotImplemented` when the RHS isn't a `Media` instance
but something else.
All tests pass locally.
(It has nothing to do with
https://code.djangoproject.com/ticket/35648
specifically but the same discussion probably applies.)
--
Ticket URL: <
https://code.djangoproject.com/ticket/36104>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.