Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.