Fixed #10811 -- Assigning unsaved objects to FK raises ValueError