#24541: save_new_objects in ModelFromsets do not handle intitial data
-------------------------------+--------------------------------------
     Reporter:  codingjoe      |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Forms          |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:  modelformset   |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by codingjoe:

Old description:

> If you create a `Formset` and pass `initial` data for some forms, the
> forms are evaluated as `has_changed` False.
> All in all that is true, but it has the the side effect that the forms in
> the formset don't get saved, tho they contain data.
>
> The error is here:
> https://github.com/django/django/blob/master/django/forms/models.py#L777-L778
>
> It should not only be checked for `has_changed` but also for initial
> data.

New description:

 If you create a `ModelFormSet` and pass `initial` data for some forms, the
 forms are evaluated as `has_changed` False.
 All in all that is true, but it has the the side effect that the forms in
 the formset don't get saved, tho they contain data.

 The error is here:
 https://github.com/django/django/blob/master/django/forms/models.py#L777-L778

 It should not only be checked for `has_changed` but also for initial data.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24541#comment:5>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.2ea4a1ba0f017113b10f42a3fee4a965%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to