#28147: Saving parent object after setting on child leads to unexpected data 
loss
-------------------------------------+-------------------------------------
               Reporter:  Erwin      |          Owner:  nobody
  Junge                              |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When saving a parent object after setting it on a child object and then
 saving the child object, no error is thrown but the FK relation is saved
 with a NULL value.

 Failing testcase:
 {{{
         # Create parent and child, save parent, save child, parent_id
 should be set
         p = Parent()
         c = Child(parent=p)
         p.save()
         c.save()
         c.refresh_from_db()
         self.assertIs(c.parent, p)
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28147>
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/053.4a142d981c283d7871a8e723db2fee18%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to