Created by: Terr
Hi,
When trying to clean a formset of forms, which contain a ReferenceField, I encountered a "Duplicate query conditions: id" error. It appears that the QuerySet used in ReferenceField.clean() assigns the result of the get() to itself. When the QuerySet is reused, the error occurs.
I fixed this by making a copy of the QuerySet before modifying it to check value of ReferenceField.