Comment 1 for bug 408528

Revision history for this message
Celso Providelo (cprov) wrote : Re: lucene2 synced from Debian, built fine but failed to upload

The traceback is available in http://launchpadlibrarian.net/29832264/vK3kLYHOztqK4D9j4T411UIoC6R.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.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)