Merge lp:~sinzui/launchpad/delete-merged-account into lp:launchpad
Status: | Merged |
---|---|
Merged at revision: | 10836 |
Proposed branch: | lp:~sinzui/launchpad/delete-merged-account |
Merge into: | lp:launchpad |
Diff against target: |
119 lines (+47/-11) 3 files modified
database/schema/pending/update-merged-person-accounts.sql (+24/-0) lib/lp/registry/doc/person-merge.txt (+11/-3) lib/lp/registry/model/person.py (+12/-8) |
To merge this branch: | bzr merge lp:~sinzui/launchpad/delete-merged-account |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+24898@code.launchpad.net |
Description of the change
This is my branch to hide the accounts of merged persons.
lp:~sinzui/launchpad/delete-merged-account
Diff size: 119
Launchpad bug: https:/
Test command: ./bin/test -vv -t person-merge
Pre-
Target release: 10.05
Hide the accounts of merged persons
-------
Recent changes to SSO require Launchpad to delete the accounts of merged
users.
ISD has its own database now and it is not aware of Launchpad person merges.
The summary of the long conversation is that Lp uses the OpenID identifier
and falls back to email address. Since the merged account has the SSO OpenID
identifier, the wrong account is used. We need to prevent Launchpad from
matching the identifier to an account of a merged person. Launchpad correctly
falls back to email address when there is no account and will update that
account's identifier as needed.
We considered deleting the account, but there are many relationships that are
tied to account. We decided to change the Launchpad account's openid
identifier to one that cannot match any identifier sent from SSO.
Rules
-----
* Change the account's openid_identifier at the end of Person.merge().
* Prepare a script to delete delete all merged accounts to
fix the data.
QA
--
* On staging, merge an account.
* Verify it is not in the database afterwards
* Login using the merged account's email address
* Verify that you login to the remaining account.
Lint
----
Linting changed files:
database/
lib/lp/
lib/lp/
Test
----
* lib/lp/
* Updated the test to verify that openid_identifier of the merged
person is changed.
Implementation
--------------
* database/
* Added a script to fix the existing data, 1500+ accounts.
* lib/lp/
* Updated Person.merge() to change the openid_identifier of the merged
person.
Hi Curtis,
a nice branch. I just have a few nitpicks, see below.
> === added file 'database/ schema/ pending/ update- merged- person- accounts. sql' schema/ pending/ update- merged- person- accounts. sql 1970-01-01 00:00:00 +0000 schema/ pending/ update- merged- person- accounts. sql 2010-05-07 14:10:52 +0000 min_messages= ERROR; displayname, openid_ identifier, openid_ identifier
> --- database/
> +++ database/
> @@ -0,0 +1,24 @@
> +-- Copyright 2010 Canonical Ltd. This software is licensed under the
> +-- GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +SET client_
> +
> +SELECT
> + Account.
> + Account.
> + 'merged-' || Account.
> +FROM Account
> + JOIN Person ON Account.id = Person.account
> +WHERE
> + Person.merged IS NOT NULL
> +;
I think we don't need the SELECT above.
> + registry/ doc/person- merge.txt' registry/ doc/person- merge.txt 2010-02-16 20:36:48 +0000 registry/ doc/person- merge.txt 2010-05-07 14:10:52 +0000 old_karma get_one( )[0]
> +-- Change the openid_identifier of merged Persons to prevent the merged
> +-- person from being selected during login.
> +UPDATE Account
> +SET openid_identifier = 'merged-' || openid_identifier
> +FROM Person
> +WHERE
> + Account.id = Person.account
> + AND Person.merged IS NOT NULL
> +;
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -161,7 +161,7 @@
> >>> sample.karma == sampleperson_
> True
>
> -A merged account gets a -merged suffix on its name.
> +A merged person gets a -merged suffix on its name.
>
> >>> from storm.store import Store
> >>> store = Store.of(marilize)
> @@ -186,8 +186,8 @@
> >>> results.
> u'name12'
>
> -The account that has been merged is flagged. We can use this to eliminate
> -merged accounts from lists etc.
> +The person that has been merged is flagged. We can use this to eliminate
> +merged person from lists etc.
s/person/persons/