Merge lp:~canonical-isd-hackers/canonical-identity-provider/862944-preferred-email-constraint into lp:canonical-identity-provider/release
Status: | Merged |
---|---|
Approved by: | Ricardo Kirkner |
Approved revision: | no longer in the source branch. |
Merged at revision: | 238 |
Proposed branch: | lp:~canonical-isd-hackers/canonical-identity-provider/862944-preferred-email-constraint |
Merge into: | lp:canonical-identity-provider/release |
Diff against target: |
130 lines (+55/-12) 2 files modified
identityprovider/models/account.py (+25/-9) identityprovider/tests/test_models_account.py (+30/-3) |
To merge this branch: | bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/862944-preferred-email-constraint |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ricardo Kirkner (community) | Approve | ||
Review via email: mp+83053@code.launchpad.net |
Commit message
Fixes 862944 by also looking for old LP emails to use for the preferred email
Description of the change
Fix for bug https:/
Problem arising from SSO model identity crisis:
- user has account '1' with no PREFERRED emails
- account '1' is linked to person 'A'
- person 'A' also has links to account '2'
- there is a preferred email for set for person 'A' for account '2'
- when attempting to log in to account '1', code attempts to set the latest account '1' email to PREFERRED
- but there is a constraint that a Person can only have one preferred email - see bug
This fixes the issue by checking both Account and Person for preferred emails.
The only question I have is whether it is valid to use a Person-based email (from another account) as the preferred email? Should we also be changing/removing the additional constraint?
hmm - I don't think this is ready yet. Need to add some tests and think through implications of using an email that is the preferred email for to a different account for the same person