Merge lp://qastaging/~sinzui/launchpad/delete-team-1 into lp://qastaging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 11340
Proposed branch: lp://qastaging/~sinzui/launchpad/delete-team-1
Merge into: lp://qastaging/launchpad
Diff against target: 53 lines (+12/-3)
3 files modified
lib/lp/registry/browser/peoplemerge.py (+3/-0)
lib/lp/registry/browser/tests/peoplemerge-views.txt (+5/-3)
lib/lp/registry/model/person.py (+4/-0)
To merge this branch: bzr merge lp://qastaging/~sinzui/launchpad/delete-team-1
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+32203@code.qastaging.launchpad.net

Description of the change

This is my branch to ensure team emails are deletes before the team is
deleted so that an oops is not raised.

    lp:~sinzui/launchpad/delete-team-1
    Diff size: 40
    Launchpad bug:
          https://bugs.launchpad.net/bugs/610850
    Test command: ./bin/test -vv -t peoplemerge-views
    Pre-implementation: no one.
    Target release: 10.09

ensure team emails are deletes before the team is deleted
----------------------------------------------------------

OOPS-1669EB4270 shows that the merge into ~registry failed.

The team did have an email address and I set the team to send to all
members
(implicitly deleting the email address). I then used the delete action
to
merge the team with ~registry

I expect the delete team rules to delete team email addresses as the
first
step of the merge. ie, calling team.setContactAddress(None).

Rules
-----

    * Add a rule to delete the team email addresses /before/ the team is
      deleted.

QA
--

    * On staging, locate a team that you are not a member of with an
email
      address. Choose to delete the team.
    * Verify the team is deleted
    * Look in the staging database and verify the team's email address
is
      not in the database.

Lint
----

Linting changed files:
  lib/lp/registry/browser/peoplemerge.py
  lib/lp/registry/browser/tests/peoplemerge-views.txt

Test
----

    * lib/lp/registry/browser/tests/peoplemerge-views.txt
      * Revised the delete team with email test to verify that email
addresses
        are deleted

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

    * lib/lp/registry/browser/peoplemerge.py
      * Added a call to setContactAddress(None) to delete the team's
addresses
        before calling doMerge()

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

The change looks good, Curtis. While reviewing I tried to understand setContactAddress and found it pretty confusing. The comment you suggested will help greatly, so please add it.

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.