Merge lp:~jtv/launchpad/bug-411514 into lp:launchpad
Proposed by
Jeroen T. Vermeulen
on 2010-02-12
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Jeroen T. Vermeulen on 2010-02-12 | ||||
| Approved revision: | not available | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~jtv/launchpad/bug-411514 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
72 lines (+36/-15) 2 files modified
lib/lp/translations/utilities/tests/test_file_importer.py (+24/-0) lib/lp/translations/utilities/translation_import.py (+12/-15) |
||||
| To merge this branch: | bzr merge lp:~jtv/launchpad/bug-411514 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | 2010-02-12 | Approve on 2010-02-12 |
|
Review via email:
|
|||
Commit Message
Fix "email address already in use" poimport oopses.
To post a comment you must log in.
| Jeroen T. Vermeulen (jtv) wrote : | # |
review:
Approve
(code)

= Bug 411514 =
Now that we're getting proper oops reports from the translations import script, it's become painfully obvious that imports are failing every day because of a bug in handling the person/account split.
Danilo did some digging and came up with this explanation: sometimes there's an Account with the email address we're looking for, but no Person is associated with it. In that case, creating a Person (and implicitly an Account) will fail because the Account already exists.
The Soyuz team has already solved this by calling IPersonSet. ensurePerson, which handles the various cases of existence, nonexistence, and partial existence.
A test exercises this scenario; I used it to reproduce the bug first. The actual code is a bit simpler now, as it now always prepares to create a person without knowing or caring whether there already is one. Another test verifies that behavior for invalid email addresses is unchanged.
For Q/A, ensure that imports still happen & watch the oopses go away. One way to trigger the former oops deliberately is to upload a translation file listing martijn at foodfight (org, not com) as the author in the header. Hoi Martijn!
Test:
{{{
./bin/test -vv -t test_file_importer
}}}
No lint.
Jeroen