#24391: UUIDField with default=uuid4 triggers validation on otherwise empty 
inline
formsets
------------------------+-------------------------------------
     Reporter:  yoyoma  |                    Owner:  timgraham
         Type:  Bug     |                   Status:  assigned
    Component:  Forms   |                  Version:  master
     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 timgraham):

 The root cause is that the default is
 
[https://github.com/django/django/blob/b2f331dc68ec3c5a34285f7af9614e4178e9a371/django/forms/forms.py#L493
 called twice] when rendering the field so the hidden initial value is
 different from what appears in the input. I think this bug was hidden with
 the common case of datetime defaults because microseconds are truncated so
 usually the two values are equal, although it seems like it should trip
 across a second boundary at some point.

 Maybe we can evaluate the default on the form field, rather than the
 widget. Backwards compatibility is the main concern.

--
Ticket URL: <https://code.djangoproject.com/ticket/24391#comment:2>
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.5653585c2666c1785a27b3ca0728fed4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to