It looks like PersonSet.ensurePerson() is behaving badly for email addresses already associated with SSO accounts.
In those cases EmailsAddress exists by has an empty 'person', so PersonSet.getByEmail will return None and ensurePerson will proceed with PersonSet.createPersonAndEmail() ... that will obviously explode trying to create a duplicated EmailAddress record.
IMHO, it could be fixed by replacing PS.getByEmail with a custom query on EmailAddress, which would allow the code to reuse the existing EmailAddress record and simply associate it with a new Person.
(I'm not sure if it's clear, but Soyuz need a Person FK)
The traceback is available in http:// launchpadlibrar ian.net/ 29832264/ vK3kLYHOztqK4D9 j4T411UIoC6R. txt
It looks like PersonSet. ensurePerson( ) is behaving badly for email addresses already associated with SSO accounts.
In those cases EmailsAddress exists by has an empty 'person', so PersonSet. getByEmail will return None and ensurePerson will proceed with PersonSet. createPersonAnd Email() ... that will obviously explode trying to create a duplicated EmailAddress record.
IMHO, it could be fixed by replacing PS.getByEmail with a custom query on EmailAddress, which would allow the code to reuse the existing EmailAddress record and simply associate it with a new Person.
(I'm not sure if it's clear, but Soyuz need a Person FK)