← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ilasc/launchpad:skip-bugbranch-registrant-close-account into launchpad:master

 

Ioana Lasc has proposed merging ~ilasc/launchpad:skip-bugbranch-registrant-close-account into launchpad:master.

Commit message:
Add Bugbranch.registrant to close-account script

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ilasc/launchpad/+git/launchpad/+merge/434172
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/launchpad:skip-bugbranch-registrant-close-account into launchpad:master.
diff --git a/lib/lp/registry/scripts/closeaccount.py b/lib/lp/registry/scripts/closeaccount.py
index df4c8ad..ede97d9 100644
--- a/lib/lp/registry/scripts/closeaccount.py
+++ b/lib/lp/registry/scripts/closeaccount.py
@@ -112,6 +112,7 @@ def close_account(username, log):
         ("bug", "owner"),
         ("bug", "who_made_private"),
         ("bugactivity", "person"),
+        ("bugbranch", "registrant"),
         ("bugnomination", "decider"),
         ("bugnomination", "owner"),
         ("bugtask", "owner"),
diff --git a/lib/lp/registry/scripts/tests/test_closeaccount.py b/lib/lp/registry/scripts/tests/test_closeaccount.py
index f63aebf..9640117 100644
--- a/lib/lp/registry/scripts/tests/test_closeaccount.py
+++ b/lib/lp/registry/scripts/tests/test_closeaccount.py
@@ -317,6 +317,18 @@ class TestCloseAccount(TestCaseWithFactory):
             self.runScript(script)
         self.assertRemoved(account_id, person_id)
 
+    def test_skips_bugbranch_registrant(self):
+        person = self.factory.makePerson()
+        person_id = person.id
+        account_id = person.account.id
+        bug = self.factory.makeBug()
+        branch = self.factory.makeBranch()
+        bug.linkBranch(branch, person)
+        script = self.makeScript([person.name])
+        with dbuser("launchpad"):
+            self.runScript(script)
+        self.assertRemoved(account_id, person_id)
+
     def test_handles_packaging_references(self):
         person = self.factory.makePerson()
         person_id = person.id

Follow ups