← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/launchpad:person-closeaccount-sprintspecification-registrant into launchpad:master

 

Guruprasad has proposed merging ~lgp171188/launchpad:person-closeaccount-sprintspecification-registrant into launchpad:master.

Commit message:
Skip sprintspecification.registrant while closing a person's account

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/launchpad/+git/launchpad/+merge/487685
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad:person-closeaccount-sprintspecification-registrant into launchpad:master.
diff --git a/lib/lp/registry/scripts/closeaccount.py b/lib/lp/registry/scripts/closeaccount.py
index f408478..120535f 100644
--- a/lib/lp/registry/scripts/closeaccount.py
+++ b/lib/lp/registry/scripts/closeaccount.py
@@ -172,6 +172,7 @@ def close_account(username, log):
         ("specification", "owner"),
         ("specification", "starter"),
         ("specificationbranch", "registrant"),
+        ("sprintspecification", "registrant"),
         ("structuralsubscription", "subscribed_by"),
         ("teammembership", "acknowledged_by"),
         ("teammembership", "last_changed_by"),
diff --git a/lib/lp/registry/scripts/tests/test_closeaccount.py b/lib/lp/registry/scripts/tests/test_closeaccount.py
index e0b0c14..13a750c 100644
--- a/lib/lp/registry/scripts/tests/test_closeaccount.py
+++ b/lib/lp/registry/scripts/tests/test_closeaccount.py
@@ -1377,3 +1377,13 @@ class TestCloseAccount(TestCaseWithFactory):
         with dbuser("launchpad"):
             self.runScript(script)
         self.assertRemoved(registrant_account_id, registrant_id)
+
+    def test_skips_sprintspecification_registrant(self):
+        person = self.factory.makePerson()
+        sprint = self.factory.makeSprint()
+        blueprint = self.factory.makeSpecification()
+        removeSecurityProxy(blueprint).linkSprint(sprint, person)
+        script = self.makeScript([person.name])
+        with dbuser("launchpad"):
+            self.runScript(script)
+        self.assertRemoved(person.account.id, person.id)