Merge lp://staging/~sinzui/launchpad/team-delete-email into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~sinzui/launchpad/team-delete-email
Merge into: lp://staging/launchpad
Diff against target: 281 lines (+151/-31)
6 files modified
database/schema/pending/delete-unused-team-addresses.sql (+30/-0)
lib/lp/registry/browser/tests/peoplemerge-views.txt (+9/-7)
lib/lp/registry/browser/tests/person-views.txt (+10/-15)
lib/lp/registry/doc/person.txt (+0/-3)
lib/lp/registry/model/person.py (+16/-6)
lib/lp/registry/tests/test_team.py (+86/-0)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/team-delete-email
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+23713@code.staging.launchpad.net

Description of the change

This is my branch to allow teams to delete old email addresses.

    lp:~sinzui/launchpad/team-delete-email
    Diff size: 282
    Launchpad bug: https://bugs.launchpad.net/bugs/250103
    Test command: ./bin/test -vv \
        -t TestTeamContactAddress
        -t doc/person.txt \
        -t person-views \
        -t peoplemerge-views
    Pre-implementation: no one
    Target release: 10.04

Allow teams to delete old email addresses
-----------------------------------------

Launchpad never deletes email addresses. When a team changes its email
address, the old one is hidden and marked valid. When a team is merged, the
old email address is marked new and hidden so that it cannot be reclaimed.
This causes lots of problems because email addresses are really owned/managed
by users and they want to reuse the addresses. LOSAs delete 1 or more email
addresses every week after a user discovers that the email address they know
they removed are still associated with a team.

Launchpad should delete the old address as the UI implies was done.

Rules
-----

    * Delete the old email address when the team sets a new contact address.
      If users want to reuse the address they must reconfirm it.
    * Provide a SQL script to remove all the historic old team email
      addresses.

QA
--

On staging where the db can be examined:
    * Add an email address to a team, then remove it.
    * Verify the team has no email address in the DB.
    * Create a mailing list for a team and set it as the contact addresses,
      then remove it.
    * Verify the team has one email address for the mailing list.
    * Add another email address.
    * Verify the team has two email addresses.

Lint
----

Linting changed files:
  database/schema/pending/delete-unused-team-addresses.sql
  lib/lp/registry/browser/tests/peoplemerge-views.txt
  lib/lp/registry/browser/tests/person-views.txt
  lib/lp/registry/doc/person.txt
  lib/lp/registry/model/person.py
  lib/lp/registry/tests/test_team.py

Test
----

    * lib/lp/registry/browser/tests/peoplemerge-views.txt
      * Updated the delete a team test to explain the only case a team can
        have a NEW email address. Updated the test to use the factory.
    * lib/lp/registry/browser/tests/person-views.txt
      * Updated the visible_email_addresses test to explain that teams may
        have two possible email addresses. Updated the test to use the
        factory.
    * lib/lp/registry/doc/person.txt
      * Updated the setContactAddress() doc not verify the email address
        that ceased to exist.
    * lib/lp/registry/tests/test_team.py
      * Added a new test to verify the conditions that setContactAddress()
        supports.

Implementation
--------------

    * database/schema/pending/delete-unused-team-addresses.sql
      * Added a script that can be run by admins to delete the historic
        data.
    * lib/lp/registry/model/person.py
      * Removed some unused variables that new pyflakes reports are lint.
      * Revised the setContactAddress() method to purge the unused team
        email addresses when the team email address is set.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Hi Curtis,

This change is very nice. I found one typo but everything else looks great.

> === modified file 'lib/lp/registry/browser/tests/peoplemerge-views.txt'
> --- lib/lp/registry/browser/tests/peoplemerge-views.txt 2010-04-12 08:11:18 +0000
> +++ lib/lp/registry/browser/tests/peoplemerge-views.txt 2010-04-19 21:35:31 +0000
> @@ -251,21 +251,23 @@
> >>> print find_tag_by_id(content, 'field.actions.delete')
> None
>
> -The registry experts should be able to delete a team with an
> -validated email address, which will be invisible, since only
> -preferred email addresses are shown for teams.
> +The registry experts can delete a team with an new email address (from

s/an new/a new

> +an import), which will be invisible, since only preferred email addresses are
> +shown for teams.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.