Code

Opened 9 months ago

Closed 8 months ago

Last modified 8 months ago

#20850 closed Bug (fixed)

MultiWidget does not respect Widget.needs_multipart_form

Reported by: tim_heap Owned by: nobody
Component: Uncategorized Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: no UI/UX: no

Description

If a widget that is wrapped with a MultiWidget has needs_multipart_form set, the MultiWidget does not reflect that. This prevents automatically setting the form enctype correctly using the Form.is_multipart method.

The ClearableFileField from django-form-utils is an example of such a widget. It combines a FileField with a Checkbox, where the Checkbox allows clearing/removing an already selected file from the form. While this particular widget is now not needed as it is included in Django in an alternate implementation, this bug still exists.

Attachments (1)

0001-Fix-MultiWidgets-not-respecting-subwidgets-need_mult.patch (2.1 KB) - added by tim_heap 9 months ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 8 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 75c87e2d38b181163a61ea99f2a17273274a3a2b:

Fixed #20850 -- Added MultiWidget.needs_multipart_form

comment:2 Changed 8 months ago by Tim Graham <timograham@…>

In 891cdf120a0751b71eb534e14f814f574904ec44:

[1.6.x] Fixed #20850 -- Added MultiWidget.needs_multipart_form

Backport of 75c87e2d38 from master

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.