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

Proposed by Curtis Hovey
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: 11387
Proposed branch: lp://qastaging/~sinzui/launchpad/delete-team-2
Merge into: lp://qastaging/launchpad
Diff against target: 67 lines (+24/-7)
2 files modified
lib/lp/registry/model/person.py (+3/-2)
lib/lp/registry/tests/test_team.py (+21/-5)
To merge this branch: bzr merge lp://qastaging/~sinzui/launchpad/delete-team-2
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) Approve
Review via email: mp+32948@code.qastaging.launchpad.net

Description of the change

This is my branch to allow renamed teams with purged mailing lists to set
their contact address.

    lp:~sinzui/launchpad/delete-team-2
    Diff size: 62
    Launchpad bug:
          https://bugs.launchpad.net/bugs/619022
    Test command: ./bin/test -vv -t TestTeamContactAddress
    Pre-implementation: EdwinGrubbs
    Target release: 10.09

Allow renamed teams with purged mailing lists to set their contact address
--------------------------------------------------------------------------

This team had a list purged, then it was renamed. The team has the old mailing
list address but the mailing list does not. This is expected.
setContactAddress should not assume that it will always have an email address
for a mailing list. It is okay to be None, since the deletion loop does the
right thing, but the MasterStore step is not needed.

There was some discussion about whether the email address should be deleted
when the list is purged. It could be, but we need a reallocation mechanism
if the list is recreated. This issue was caused by a rename, and we still
have many examples where renaming persons breaks other things. We really
want to make rename safe for mailing lists and PPAs. Since renames can happen
via the SQL, we cannot entertain such an enhancement until we have a UI
that supports all the cases.

Rules
-----

    * Check is mailing_list_email is not None before getting the master store.

QA
--

    * Visit https://edge.launchpad.net/~ubuntu-l10n-nds
    * Delete the team (which implicitly sets the address to None).
    * Verify you see the people and teams search page.

Lint
----

Paste Linting changed files:
  lib/lp/registry/model/person.py
  lib/lp/registry/tests/test_team.py

I can clean up this file after the review.
./lib/lp/registry/model/person.py
      66: 'safe_hasattr' imported but unused
      64: E501 line too long (83 characters)
      68: E501 line too long (80 characters)
    1450: W291 trailing whitespace
    1491: W291 trailing whitespace
    1492: E501 line too long (82 characters)
    1522: E301 expected 1 blank line, found 0
    1559: E501 line too long (82 characters)
      64: Line exceeds 78 characters.
      68: Line exceeds 78 characters.
    1450: Line has trailing whitespace.
    1478: Line exceeds 78 characters.
    1491: Line has trailing whitespace.
    1492: Line exceeds 78 characters.
    1559: Line exceeds 78 characters. lint report

Test
----

    * lib/lp/registry/tests/test_team.py
      * Added a test that repeats the events that happened to the problem
        team and verified it can set its contact address.

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

    * lib/lp/registry/model/person.py
      * Added check to see if the address is None before

--
__Curtis C. Hovey_________
http://launchpad.net/

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Curtis,

This looks good. One minor comment: login_person and login_celebrity are not in alphabetical order.

-Edwin

review: Approve

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.