﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28147	Saving parent object after setting on child leads to unexpected data loss	Erwin Junge	robinh00d	"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)
}}}

Patch available: https://github.com/django/django/pull/8434"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed		Tim Martin jon.dufresne@…	Ready for checkin	1	0	0	0	0	0
