Opened 4 weeks ago

Last modified 4 weeks ago

#36104 assigned Cleanup/optimization

forms.Media shouldn't expect media objects only

Reported by: Matthias Kestenholz Owned by: Matthias Kestenholz
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no
Pull Requests:19058

Description

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.)

According to the ticket's flags, the next step(s) to move this issue forward are:

  • For anyone except the patch author to review the patch using the patch review checklist and either mark the ticket as "Ready for checkin" if everything looks good, or leave comments for improvement and mark the ticket as "Patch needs improvement".

Change History (2)

comment:1 by Matthias Kestenholz, 4 weeks ago

comment:2 by Natalia Bidart, 4 weeks ago

Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization
Version: 5.1dev

Accepting, this is somewhat similar in concept to #35648.

Last edited 4 weeks ago by Natalia Bidart (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top