~maxiberta/canonical-identity-provider/vanilla-sshkeys-debug

Viewing all changes in revision 1709.

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Jonathan Hartley
  • Date: 2020-01-10 17:06:04 UTC
  • mfrom: (1703.1.24 canonical-identity-provider)
  • Revision ID: otto-copilot@canonical.com-20200110170604-di4cibodp57c5ud7
Unconditionally error if "not account.can_reset_password"

Don't try to special-case "deactivated" accounts, since we cannot reach
this code with that account.status value.

Don't special case "suspended" accounts, since that is the only
status value which can reach this bit of code.

Instead, just unconditionally refuse to send the password reset
and return an error.

There was a test of special-case for "deactivated" accounts,
but to reach that code, the test monkey-patched to create an
impossible situation. Without that patching, the test now
demonstrates what actually happens (both before this change
and after it) - i.e. a deactivated account can send a password
reset email.

Add a comment about test assertions using mock_logging,
which actually do nothing.

Fix a few comment typos.

Merged from https://code.launchpad.net/~tartley/canonical-identity-provider/rm-deactivated-check/+merge/377387

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: