#29205: MultiValueField ignores a required value of a sub field
--------------------------------+------------------------------------
     Reporter:  Takayuki Hirai  |                    Owner:  nobody
         Type:  Bug             |                   Status:  new
    Component:  Forms           |                  Version:  1.11
     Severity:  Normal          |               Resolution:
     Keywords:                  |             Triage Stage:  Accepted
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+------------------------------------

Comment (by jhrr):

 Adding something like this certainly does cause some failures in test
 cases where the `required` string has been disappeared from the emitted
 `HTML`. Looking into further isolating some better test cases.


 {{{
 def build_widget_attrs(self, attrs, widget=None):
     widget = widget or self.field.widget
     attrs = dict(attrs)  # Copy attrs to avoid modifying the argument.
     if widget.use_required_attribute(self.initial) and self.field.required
 and self.form.use_required_attribute:
         if hasattr(self.field, 'require_all_fields'):
             if not widget.is_required and not
 self.field.require_all_fields:
                 attrs['required'] = False
         else:
             attrs['required'] = True
     if self.field.disabled:
         attrs['disabled'] = True
     return attrs
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29205#comment:9>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5eaf715aabcf21d5f99f5518a1120ce4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to