Merge lp:~tartley/canonical-identity-provider/rm-no-verified-address-para into lp:canonical-identity-provider/release
Status: | Merged |
---|---|
Approved by: | Jonathan Hartley |
Approved revision: | no longer in the source branch. |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | lp:~tartley/canonical-identity-provider/rm-no-verified-address-para |
Merge into: | lp:canonical-identity-provider/release |
Prerequisite: | lp:~tartley/canonical-identity-provider/status-code-diagnostics |
Diff against target: |
43 lines (+0/-22) 2 files modified
src/api/v20/handlers.py (+0/-8) src/api/v20/tests/test_handlers.py (+0/-14) |
To merge this branch: | bzr merge lp:~tartley/canonical-identity-provider/rm-no-verified-address-para |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matias Bordese (community) | Approve | ||
Review via email: mp+377382@code.launchpad.net |
Commit message
Remove code that cannot be reached.
The containing 'if not account.
16 lines up from the deletion,
does not check whether there are any validated email addresses.
Instead it just checks that account.status must be either
Suspended or Deleted.
Suspended accounts are handled by an early return,
9 lines up from the deletion.
Deleted accounts also delete their associated email addresses,
so can not be retrieved by the Account.
near the start of this method.
There was a test for this deleted code,
but it monkey patched a fake value to make this code reachable.
I tried replacing the test with one that didn't do monkey patching
(e.g. using a deleted account would be the only way)
but was unable to make the code reachable.
In practice, accounts with no validated email addresses pass
right by this code, and end up reading from account.
14 lines below the deletion,
which falls back to using a new email address.
Reviewed possible account status values, makes sense to me.
Even more, DEACTIVATED is not possible here (but I just noted you comment and fix on this in your next MP!).